[PATCH] D147994: Handle null dereference
Akshay Khadse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 11 00:27:21 PDT 2023
akshaykhadse created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
akshaykhadse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147994
Files:
llvm/lib/CodeGen/WinEHPrepare.cpp
Index: llvm/lib/CodeGen/WinEHPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/WinEHPrepare.cpp
+++ llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -251,6 +251,7 @@
State = EHInfo.CxxUnwindMap[State].ToState; // Retrive next State
} else if (isa<InvokeInst>(TI)) {
auto *Call = dyn_cast<CallBase>(TI);
+ assert(Call);
const Function *Fn = Call->getCalledFunction();
if (Fn && Fn->isIntrinsic() &&
(Fn->getIntrinsicID() == Intrinsic::seh_scope_begin ||
@@ -319,6 +320,7 @@
State = EHInfo.SEHUnwindMap[State].ToState; // Retrive next State
} else if (isa<InvokeInst>(TI)) {
auto *Call = dyn_cast<CallBase>(TI);
+ assert(Call);
const Function *Fn = Call->getCalledFunction();
if (Fn && Fn->isIntrinsic() &&
Fn->getIntrinsicID() == Intrinsic::seh_try_begin)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147994.512353.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230411/9f3c04f9/attachment.bin>
More information about the llvm-commits
mailing list