[PATCH] D81220: [DWARFYAML][debug_ranges] Make the "Offset" field optional.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 01:36:25 PDT 2020


jhenderson added a comment.

You should also have a test case either in this test or D81217 <https://reviews.llvm.org/D81217> that shows what happens when you use an offset that is either higher than where you are already, or lower.



================
Comment at: llvm/lib/ObjectYAML/DWARFEmitter.cpp:122-124
+      assert(*DebugRanges.Offset >= CurrOffset &&
+             "Offset should be greater than or equal to the bytes that we have "
+             "written");
----------------
I don't think this wants to be an assert - it should be an error, right? If you specify a lower offset than the current position (e.g. 0 for the second set), you want an error since you can't place it there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81220





More information about the llvm-commits mailing list