]> granicus.if.org Git - clang/commitdiff
Don't try to check jump scopes in invalid functions. Fixes
authorJohn McCall <rjmccall@apple.com>
Thu, 20 May 2010 07:05:55 +0000 (07:05 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 20 May 2010 07:05:55 +0000 (07:05 +0000)
<rdar://problem/7995494>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104217 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 30eaee423bd5c90a27dd4b112c23682a5a1bd41c..af9848fb1aba9037d7e5459ac8211fc0ab715a1c 100644 (file)
@@ -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))