Reasonable assumptions can be made when a parsed address length does not match the expected length, so there's no need for this to be fatal.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Early ping - I'd like to get this and the other related reviews in before the release branch is created if possible.
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | ||
---|---|---|
597 | I find these lines a bit hard to follow, without prior understanding of the whole idea. I would suggest reorganize them like this: uint8_t ExtractorAddressSize = DebugLineData.getAddressSize(); if (ExtractorAddressSize != Len - 1) { RecoverableErrorCallback(...); } // Assuming that the line table is correct, temporarily override the address size. DebugLineData.setAddressSize(Len - 1); State.Row.Address.Address = ... // Restore the address size if the extractor already had it. if (ExtractorAddressSize != 0) DebugLineData.setAddressSize(ExtractorAddressSize); What do you think? |
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | ||
---|---|---|
597 | Yes, I think that should work, with one minor change to the error check - a value of zero from the extractor shouldn't cause an error. I'll try that. |
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | ||
---|---|---|
8–1 | @jhenderson, it looks like that an incorrect Len value, i. e. not 1, 2, 4 or 8, eventually leads to a crash in DataExtractor::getUnsigned(). Please add a patch to check that case. |
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | ||
---|---|---|
8–1 | Will do! |
@jhenderson, it looks like that an incorrect Len value, i. e. not 1, 2, 4 or 8, eventually leads to a crash in DataExtractor::getUnsigned(). Please add a patch to check that case.