diff options
| author | Steve Naroff <snaroff@apple.com> | 2009-04-15 16:58:41 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2009-04-15 16:58:41 +0000 |
| commit | 6f84266619acb29707ebd2c1d3f50b8fb17b83cf (patch) | |
| tree | adce2b98bc9627a704f0b90053de386a55696fca | |
| parent | e6c831deb226938db304918f43efa0100b3d129e (diff) | |
| download | bcm5719-llvm-6f84266619acb29707ebd2c1d3f50b8fb17b83cf.tar.gz bcm5719-llvm-6f84266619acb29707ebd2c1d3f50b8fb17b83cf.zip | |
Revert previous patch (will commit a fix soon).
llvm-svn: 69178
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 13 | ||||
| -rw-r--r-- | clang/test/Sema/scope-check.c | 8 | ||||
| -rw-r--r-- | clang/test/SemaObjC/scope-check-try-catch.m | 4 |
3 files changed, 17 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8b7e26de225..a2984657168 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -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(); } } diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 20cecbf3f30..d09ad9c5d55 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/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/clang/test/SemaObjC/scope-check-try-catch.m b/clang/test/SemaObjC/scope-check-try-catch.m index d01dba0778a..2aac497784e 100644 --- a/clang/test/SemaObjC/scope-check-try-catch.m +++ b/clang/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 |

