]> granicus.if.org Git - clang/commitdiff
Revert previous patch (will commit a fix soon).
authorSteve Naroff <snaroff@apple.com>
Wed, 15 Apr 2009 16:58:41 +0000 (16:58 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 15 Apr 2009 16:58:41 +0000 (16:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/Sema/scope-check.c
test/SemaObjC/scope-check-try-catch.m

index 8b7e26de225005ce07006c4c3d7a6f7a30f5647c..a2984657168d8243b2dc2724ff1bf2f0ab262e84 100644 (file)
@@ -2935,11 +2935,10 @@ void Sema::RecursiveCalcLabelScopes(llvm::DenseMap<Stmt*, void*>& LabelScopeMap,
     Stmt* CurCompound = isa<CompoundStmt>(*i) ? *i : ParentCompoundStmt;
     RecursiveCalcLabelScopes(LabelScopeMap, PopScopeMap, ScopeStack,
                              *i, CurCompound);
-    while (ScopeStack.size() && PopScopeMap[ScopeStack.back()] == CurStmt) {
-      ScopeStack.pop_back();
-    }
   }
-
+  while (ScopeStack.size() && PopScopeMap[ScopeStack.back()] == CurStmt) {
+    ScopeStack.pop_back();
+  }
 }
 
 void Sema::RecursiveCalcJumpScopes(llvm::DenseMap<Stmt*, void*>& LabelScopeMap,
@@ -2970,9 +2969,9 @@ void Sema::RecursiveCalcJumpScopes(llvm::DenseMap<Stmt*, void*>& LabelScopeMap,
     if (isa<DeclStmt>(*i)) continue;
     RecursiveCalcJumpScopes(LabelScopeMap, PopScopeMap, GotoScopeMap,
                             ScopeStack, *i);
-    while (ScopeStack.size() && PopScopeMap[ScopeStack.back()] == CurStmt) {
-      ScopeStack.pop_back();
-    }
+  }
+  while (ScopeStack.size() && PopScopeMap[ScopeStack.back()] == CurStmt) {
+    ScopeStack.pop_back();
   }
 }
 
index 20cecbf3f301739b09b908e7b5567852e89f704d..d09ad9c5d5526ec43cf74e4db59362326a777f29 100644 (file)
@@ -22,3 +22,11 @@ int test3() {
   L:
   return a;
 }
+
+int test4(int x) {
+ goto L; // expected-error{{illegal jump}}
+ int a[x];
+ test4(x);
+ L:
+ return sizeof a;
+}
index d01dba0778a6b9cb15c2f4d9a7200830eb19d0c6..2aac497784e6de3bdf93c7f846caf58ef343275b 100644 (file)
@@ -17,10 +17,12 @@ L3: ;
   }
 }
 
+#if 0
+// FIXME
 void f0(int a) {
   if (a) goto L0;
   @try {} @finally {}
  L0:
   return;
 }
-
+#endif