[PATCH] D147994: Handle null dereference

Akshay Khadse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 22:28:32 PDT 2023


akshaykhadse updated this revision to Diff 512657.
akshaykhadse added a comment.

Address review comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147994/new/

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
@@ -250,7 +250,7 @@
       // Retrive the new State
       State = EHInfo.CxxUnwindMap[State].ToState; // Retrive next State
     } else if (isa<InvokeInst>(TI)) {
-      auto *Call = dyn_cast<CallBase>(TI);
+      auto *Call = cast<CallBase>(TI);
       const Function *Fn = Call->getCalledFunction();
       if (Fn && Fn->isIntrinsic() &&
           (Fn->getIntrinsicID() == Intrinsic::seh_scope_begin ||
@@ -318,7 +318,7 @@
       // Retrive the new State.
       State = EHInfo.SEHUnwindMap[State].ToState; // Retrive next State
     } else if (isa<InvokeInst>(TI)) {
-      auto *Call = dyn_cast<CallBase>(TI);
+      auto *Call = cast<CallBase>(TI);
       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.512657.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230412/f3008098/attachment.bin>


More information about the llvm-commits mailing list