diff options
author | John McCall <rjmccall@apple.com> | 2010-05-20 07:05:55 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-20 07:05:55 +0000 |
commit | dae69ef4c59fd4b75b956796909592debd7e9bc7 (patch) | |
tree | cea0398d861a9cdcd33e940fffefe97284c684fc /lib/Sema/SemaDecl.cpp | |
parent | cb359df81b83dd4f938d05cb9cf5c34bd20068bd (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.cpp | 4 |
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)) |