[PATCH] D121336: [BOLT][NFC] Check errors from Obj.dynamicEntries
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 9 13:54:40 PST 2022
Amir created this revision.
Herald added a reviewer: rafauler.
Herald added a subscriber: ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.
Addresses fuzzer crash
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121336
Files:
bolt/lib/Rewrite/RewriteInstance.cpp
Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -5135,8 +5135,10 @@
"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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121336.414209.patch
Type: text/x-patch
Size: 744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220309/46cb19ba/attachment.bin>
More information about the llvm-commits
mailing list