[cfe-commits] r126472 - in /cfe/trunk: lib/CodeGen/CGCleanup.cpp test/CodeGenCXX/exceptions.cpp

John McCall rjmccall at apple.com
Thu Feb 24 20:19:13 PST 2011


Author: rjmccall
Date: Thu Feb 24 22:19:13 2011
New Revision: 126472

URL: http://llvm.org/viewvc/llvm-project?rev=126472&view=rev
Log:
Tame an assert;  the scope depth of a jump destination does not
necessarily enclose the innermost normal cleanup depth, because
the top of the jump scope stack might be an EH cleanup or EH scope.
Fixes PR9303.


Modified:
    cfe/trunk/lib/CodeGen/CGCleanup.cpp
    cfe/trunk/test/CodeGenCXX/exceptions.cpp

Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=126472&r1=126471&r2=126472&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Thu Feb 24 22:19:13 2011
@@ -876,7 +876,7 @@
 ///
 /// As a side-effect, this method clears the insertion point.
 void CodeGenFunction::EmitBranchThroughCleanup(JumpDest Dest) {
-  assert(Dest.getScopeDepth().encloses(EHStack.getInnermostNormalCleanup())
+  assert(Dest.getScopeDepth().encloses(EHStack.stable_begin())
          && "stale jump destination");
 
   if (!HaveInsertPoint())

Modified: cfe/trunk/test/CodeGenCXX/exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions.cpp?rev=126472&r1=126471&r2=126472&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions.cpp Thu Feb 24 22:19:13 2011
@@ -293,3 +293,15 @@
     }
   }
 }
+
+// PR9303: invalid assert on this
+namespace test6 {
+  bool cond();
+  void test() {
+    try {
+    lbl:
+      if (cond()) goto lbl;
+    } catch (...) {
+    }
+  }
+}





More information about the cfe-commits mailing list