[PATCH] D147995: Handle null dereference
Akshay Khadse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 11 00:29:28 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/D147995
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: D147995.512355.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230411/a5a74f22/attachment.bin>
More information about the llvm-commits
mailing list