summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 19:42:37 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 19:42:37 +0000
commit7535f41c6673613009a22e2b2e9654d6f5eba40e (patch)
tree075f57332a008fefda3978dcce06d7d4666c561c /clang/lib/Sema
parent8560addfa690a2987fa143f9456e0c355e3834dd (diff)
downloadbcm5719-llvm-7535f41c6673613009a22e2b2e9654d6f5eba40e.tar.gz
bcm5719-llvm-7535f41c6673613009a22e2b2e9654d6f5eba40e.zip
first step to getting switches giving "jump into vla scope" errors.
llvm-svn: 69461
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 772db3b2478..48351407d98 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3070,8 +3070,13 @@ void JumpScopeChecker::VerifyJumps() {
assert(LabelAndGotoScopes.count(GS->getLabel()) && "Label not visited?");
CheckJump(GS, LabelAndGotoScopes[GS->getLabel()],
diag::err_goto_into_protected_scope);
- } else if (isa<SwitchStmt>(Jump)) {
- // FIXME: Handle this.
+ } else if (SwitchStmt *SS = dyn_cast<SwitchStmt>(Jump)) {
+ for (SwitchCase *SC = SS->getSwitchCaseList(); SC;
+ SC = SC->getNextSwitchCase()) {
+ assert(LabelAndGotoScopes.count(SC) && "Case not visited?");
+ CheckJump(SS, LabelAndGotoScopes[SC],
+ diag::err_switch_into_protected_scope);
+ }
continue;
} else {
assert(isa<IndirectGotoStmt>(Jump));
OpenPOWER on IntegriCloud