[PATCH] D62805: [DebugInfo] Fix possible invalid dereference of non-engaged Optional.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 05:28:45 PDT 2019


courbet marked an inline comment as done.
courbet added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h:185
+   return AFI->OffsetInBits < BFI->OffsetInBits;
+  return AFI.hasValue() < BFI.hasValue();
 }
----------------
probinson wrote:
> Can you point to a test where one or both values do not have a fragment?
I see that happening when there is a single value that does not have a fragment. My stdlib has:

`__glibcxx_requires_irreflexive(__first, __last);`

as a first statement in sort, which with `_GLIBCXX_DEBUG` expands to:

```
_GLIBCXX_DEBUG_VERIFY(_First == _Last || !(*_First < *_First) ...
```

The above calls `operator<`. I can reproduce with:

`./bin/llc < /usr/local/google/home/courbet/llvm/llvm-project/llvm/test/CodeGen/X86/fold-sext-trunc.ll -mtriple=x86_64--`



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62805/new/

https://reviews.llvm.org/D62805





More information about the llvm-commits mailing list