[PATCH] D130535: add a nullptr check for DW_AT_call_site to ensure Function will not be empty
Rui Zhong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 25 17:25:43 PDT 2022
zr33 created this revision.
Herald added a reviewer: rafauler.
Herald added a subscriber: ayermolo.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
zr33 requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D130535
Files:
bolt/lib/Rewrite/DWARFRewriter.cpp
Index: bolt/lib/Rewrite/DWARFRewriter.cpp
===================================================================
--- bolt/lib/Rewrite/DWARFRewriter.cpp
+++ bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -485,7 +485,8 @@
Optional<uint64_t> Address = AttrVal.V.getAsAddress();
const BinaryFunction *Function =
BC.getBinaryFunctionContainingAddress(*Address);
- const uint64_t UpdatedAddress =
+ if(!Function) return;
+ const uint64_t UpdatedAddress =
Function->translateInputToOutputAddress(*Address);
const uint32_t Index =
AddrWriter->getIndexFromAddress(UpdatedAddress, Unit);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130535.447525.patch
Type: text/x-patch
Size: 646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220726/07308fe6/attachment.bin>
More information about the llvm-commits
mailing list