aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
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
commit366920a45e3e278d35cbc3bc74d9d0676ae87dfe (patch)
tree44e5b4e59df2569b04da38f7427aea23e7ca5131 /lib/Sema/SemaDecl.cpp
parent5718a351b3da578366ec6f07670ca33b7d9726a3 (diff)
first step to getting switches giving "jump into vla scope" errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 772db3b247..48351407d9 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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));