[llvm] [SjLjEHPrepare] Fix callsite problem (PR #67264)

Kazushi Marukawa via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 24 07:28:42 PDT 2023


================
@@ -442,9 +442,19 @@ bool SjLjEHPrepare::setupEntryBlockAndCallSites(Function &F) {
   for (BasicBlock &BB : F) {
     if (&BB == &F.front())
       continue;
-    for (Instruction &I : BB)
-      if (I.mayThrow())
-        insertCallSiteStore(&I, -1);
+    for (Instruction &I : BB) {
+      // Partially revert b61fd7f modifications.  Stop using "I.mayThrow()"
+      // here.  Using it inserts no-action marker to just before invoke
+      // instructions like "invoke void @__cxa_bad_cast()".  That means
+      // tests having exception and try/catch in the identical function
+      // are broken.  For example, tests like test_aux_runtime.pass.cpp.
+      if (CallInst *CI = dyn_cast<CallInst>(&I)) {
----------------
kaz7 wrote:

Thank you for the correction.

https://github.com/llvm/llvm-project/pull/67264


More information about the llvm-commits mailing list