aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-20 07:05:55 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-20 07:05:55 +0000
commitdae69ef4c59fd4b75b956796909592debd7e9bc7 (patch)
treecea0398d861a9cdcd33e940fffefe97284c684fc /lib/Sema/SemaDecl.cpp
parentcb359df81b83dd4f938d05cb9cf5c34bd20068bd (diff)
Don't try to check jump scopes in invalid functions. Fixes
<rdar://problem/7995494>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 30eaee423b..af9848fb1a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4693,7 +4693,9 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg,
// Verify that that gotos and switch cases don't jump into scopes illegally.
// Verify that that gotos and switch cases don't jump into scopes illegally.
- if (FunctionNeedsScopeChecking() && !hasAnyErrorsInThisFunction())
+ if (FunctionNeedsScopeChecking() &&
+ !FD->isInvalidDecl() &&
+ !hasAnyErrorsInThisFunction())
DiagnoseInvalidJumps(Body);
if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(dcl))