mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-23 07:52:06 +00:00
Fix code to deal with recent LLVM changes.
https://reviews.llvm.org/D26526 llvm-svn: 286598
This commit is contained in:
parent
82f12b149f
commit
a6ccd19035
@ -877,10 +877,13 @@ readCompUnit(const NormalizedFile &normalizedFile,
|
|||||||
// FIXME: Cribbed from llvm-dwp -- should share "lightweight CU DIE
|
// FIXME: Cribbed from llvm-dwp -- should share "lightweight CU DIE
|
||||||
// inspection" code if possible.
|
// inspection" code if possible.
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
llvm::dwarf::DwarfFormat Format = llvm::dwarf::DwarfFormat::DWARF32;
|
||||||
auto infoData = dataExtractorFromSection(normalizedFile, info);
|
auto infoData = dataExtractorFromSection(normalizedFile, info);
|
||||||
uint32_t length = infoData.getU32(&offset);
|
uint32_t length = infoData.getU32(&offset);
|
||||||
if (length == 0xffffffff)
|
if (length == 0xffffffff) {
|
||||||
|
Format = llvm::dwarf::DwarfFormat::DWARF64;
|
||||||
infoData.getU64(&offset);
|
infoData.getU64(&offset);
|
||||||
|
}
|
||||||
else if (length > 0xffffff00)
|
else if (length > 0xffffff00)
|
||||||
return llvm::make_error<GenericError>("Malformed DWARF in " + path);
|
return llvm::make_error<GenericError>("Malformed DWARF in " + path);
|
||||||
|
|
||||||
@ -927,7 +930,7 @@ readCompUnit(const NormalizedFile &normalizedFile,
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
llvm::DWARFFormValue::skipValue(form, infoData, &offset, version,
|
llvm::DWARFFormValue::skipValue(form, infoData, &offset, version,
|
||||||
addrSize);
|
addrSize, Format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tu;
|
return tu;
|
||||||
|
Loading…
Reference in New Issue
Block a user