[PATCH] D71546: [MachO] Fix detecting malformed DWARF.
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 00:09:39 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5279f96577af: [MachO] Fix detecting malformed DWARF. (authored by ikudrin).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71546/new/
https://reviews.llvm.org/D71546
Files:
lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
Index: lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
===================================================================
--- lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
+++ lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
@@ -879,11 +879,11 @@
llvm::dwarf::DwarfFormat Format = llvm::dwarf::DwarfFormat::DWARF32;
auto infoData = dataExtractorFromSection(normalizedFile, info);
uint32_t length = infoData.getU32(&offset);
- if (length == 0xffffffff) {
+ if (length == llvm::dwarf::DW_LENGTH_DWARF64) {
Format = llvm::dwarf::DwarfFormat::DWARF64;
infoData.getU64(&offset);
}
- else if (length > 0xffffff00)
+ else if (length >= llvm::dwarf::DW_LENGTH_lo_reserved)
return llvm::make_error<GenericError>("Malformed DWARF in " + path);
uint16_t version = infoData.getU16(&offset);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71546.234223.patch
Type: text/x-patch
Size: 847 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191217/d715c642/attachment.bin>
More information about the llvm-commits
mailing list