[cfe-commits] r69742 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/Sema/block-misc.c
Chris Lattner
sabre at nondot.org
Tue Apr 21 15:38:46 PDT 2009
Author: lattner
Date: Tue Apr 21 17:38:46 2009
New Revision: 69742
URL: http://llvm.org/viewvc/llvm-project?rev=69742&view=rev
Log:
Fix rdar://6814047, a crash on invalid in blocks code I noticed when
working on the previous fix.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/Sema/block-misc.c
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=69742&r1=69741&r2=69742&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Apr 21 17:38:46 2009
@@ -4755,8 +4755,8 @@
CurFunctionNeedsScopeChecking = CurBlock->SavedFunctionNeedsScopeChecking;
// Pop off CurBlock, handle nested blocks.
+ PopDeclContext();
CurBlock = CurBlock->PrevBlockInfo;
-
// FIXME: Delete the ParmVarDecl objects as well???
}
Modified: cfe/trunk/test/Sema/block-misc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-misc.c?rev=69742&r1=69741&r2=69742&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-misc.c (original)
+++ cfe/trunk/test/Sema/block-misc.c Tue Apr 21 17:38:46 2009
@@ -112,6 +112,13 @@
^{ break; }(); // expected-error {{'break' statement not in loop or switch statement}}
}
+
+void (^test12f)(void);
+void test12() {
+ test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
+}
+
+
// rdar://6808730
void *test13 = ^{
int X = 32;
@@ -131,9 +138,3 @@
};
};
}
-
-void (^test12f)(void);
-void test12() {
- test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
-}
-
More information about the cfe-commits
mailing list