forked from OSchip/llvm-project
[BOLT][NFC] Check errors from Obj.dynamicEntries
Addresses fuzzer crash Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D121336
This commit is contained in:
parent
83b8878fbb
commit
d16bbc5340
|
@ -5135,8 +5135,10 @@ Error RewriteInstance::readELFDynamic(ELFObjectFile<ELFT> *File) {
|
|||
"dynamic section sizes should match");
|
||||
|
||||
// Go through all dynamic entries to locate entries of interest.
|
||||
typename ELFT::DynRange DynamicEntries =
|
||||
cantFail(Obj.dynamicEntries(), "error accessing dynamic table");
|
||||
auto DynamicEntriesOrErr = Obj.dynamicEntries();
|
||||
if (!DynamicEntriesOrErr)
|
||||
return DynamicEntriesOrErr.takeError();
|
||||
typename ELFT::DynRange DynamicEntries = DynamicEntriesOrErr.get();
|
||||
|
||||
for (const Elf_Dyn &Dyn : DynamicEntries) {
|
||||
switch (Dyn.d_tag) {
|
||||
|
|
Loading…
Reference in New Issue