[PATCH] D102355: Add support for DWARF embedded source to llvm-symbolizer

Alex Orlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 16 00:45:36 PDT 2021


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


================
Comment at: llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp:305
+      std::string SourceCopy;
+      if (*Source.end() != '\0') {
+        SourceCopy = Source.str();
----------------
aorlov wrote:
> dblaikie wrote:
> > It's not valid to dereference an end iterator like this.
> > 
> > What is this code intended to address?
> Note llvm::line_iterator is badly designed. 
> It is checks *Pos == '\0' in many places instead of comparing Pos with Buffer.end().
> It requires '\0' at the end of buffer which is not necessary actually.
> Look at an assert on llvm/lib/Support/LineIterator.cpp, line 47.
Note the current implementation of `line_iterator` can be used with the full source, but not with the pruned source if it didn't coincide with the end of the source file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102355



More information about the llvm-commits mailing list