[PATCH] D130535: [BOLT][DWARF] 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:29:42 PDT 2022
zr33 updated this revision to Diff 447527.
zr33 added a comment.
git-clang-format
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130535/new/
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,6 +485,8 @@
Optional<uint64_t> Address = AttrVal.V.getAsAddress();
const BinaryFunction *Function =
BC.getBinaryFunctionContainingAddress(*Address);
+ if (!Function)
+ return;
const uint64_t UpdatedAddress =
Function->translateInputToOutputAddress(*Address);
const uint32_t Index =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130535.447527.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220726/e0fca3bc/attachment.bin>
More information about the llvm-commits
mailing list