[PATCH] D78736: [DWARF5]: Added support for dumping strx forms in llvm-dwarfdump

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 09:07:34 PDT 2020


ikudrin added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp:154
       StrOffset = Data.getRelocatedValue(/*OffsetSize=*/4, &Offset);
-      E.MacroStr = StringExtractor.getCStr(&StrOffset);
+      assert(StringExtractor && "String Extractor not found");
+      E.MacroStr = StringExtractor->getCStr(&StrOffset);
----------------
SouraVX wrote:
> ikudrin wrote:
> > `assert` should not be used for the cases when malicious user input may trigger it.
> This `String Extractor` is innocuous in a sense, it is passed as parameters by functions up in the stack. So I left this ``assert` as it is. ? Are you okay with this.
> Other asserts, I've replaced with error handling.
What if a malformed `.debug_macinfo` section contains a `DW_MACRO_define_strp` entry? Does the code have any protection against that?


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

https://reviews.llvm.org/D78736





More information about the llvm-commits mailing list