[PATCH] D43470: [DebugInfo] Prevent crash when .debug_line line_range is zero
Paul Robinson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 3 08:34:50 PST 2020
probinson added a comment.
I see a pre-merge clang-format alert in DWARFDebugLine.h that you should take care of.
================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:668
+ LineTable->Prologue.LineRange)
+ : 0;
Row.Line += LineOffset;
----------------
This seems a bit much for a ternary operator.
================
Comment at: llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp:981
+ : Base + AdvanceIncr;
+ }
+
----------------
While you _can_ write this in one line, I think it's clearer to write
```
if (LineRange == 0)
return Base + AdvanceIncr;
return AdjustAddressFixtureBase::getAdjustedAddr( ... );
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D43470/new/
https://reviews.llvm.org/D43470
More information about the llvm-commits
mailing list