This patch helps make yaml2obj emit an error message when we try to assign an invalid offset to the entry of the 'debug_ranges' section.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
---|---|---|
134–140 | Do you need the new cast? If I've followed it correctly, Offset is a Hex64, so is already a 64-bit number. | |
138–139 | I think this should be " must be greater than or equal to the number of bytes written already (0x" | |
llvm/test/tools/yaml2obj/ELF/DWARF/debug-ranges.yaml | ||
317 | invalid offset to the -> invalid offset to an | |
337 | Let's make this 0x1A to test the edge case (i.e. no off-by-one error). |
Address comments.
Thanks for reviewing.
llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
---|---|---|
134–140 | Yes, but the compiler complains that 'Use of overloaded operator '<' is ambiguous'. So we have to explicitly cast it to uint64_t. |
llvm/test/tools/yaml2obj/ELF/DWARF/debug-ranges.yaml | ||
---|---|---|
337 | Oops, sorry, I failed at hex :-) I meant 0x1f, i.e. exactly one less than the permitted value! |
I think this should be " must be greater than or equal to the number of bytes written already (0x"