From: Steve Naroff Date: Wed, 15 Apr 2009 16:58:41 +0000 (+0000) Subject: Revert previous patch (will commit a fix soon). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b6823d48da16b64cfb13d818860a21472183ca0;p=clang Revert previous patch (will commit a fix soon). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69178 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 8b7e26de22..a298465716 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2935,11 +2935,10 @@ void Sema::RecursiveCalcLabelScopes(llvm::DenseMap& LabelScopeMap, Stmt* CurCompound = isa(*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& LabelScopeMap, @@ -2970,9 +2969,9 @@ void Sema::RecursiveCalcJumpScopes(llvm::DenseMap& LabelScopeMap, if (isa(*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(); } } diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index 20cecbf3f3..d09ad9c5d5 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -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; +} diff --git a/test/SemaObjC/scope-check-try-catch.m b/test/SemaObjC/scope-check-try-catch.m index d01dba0778..2aac497784 100644 --- a/test/SemaObjC/scope-check-try-catch.m +++ b/test/SemaObjC/scope-check-try-catch.m @@ -17,10 +17,12 @@ L3: ; } } +#if 0 +// FIXME void f0(int a) { if (a) goto L0; @try {} @finally {} L0: return; } - +#endif