aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 20:05:34 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 20:05:34 +0000
commit4f2aac33fe0e181c1c96bc9b502343935a794b5e (patch)
tree57f9feb5829def4392af849ce71d39615b0cdae2 /lib/Parse/ParseExpr.cpp
parentea29a3a0d6948c4a51a261d19ec1a585d2a9c779 (diff)
fix two error paths out of ParseBlockLiteralExpression to
call ActOnBlockError so that CurBlock gets popped. This fixes a crash on test/block-syntax-error.c when this new assertion is enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 47e364e361..ec36fedc2d 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -1342,6 +1342,7 @@ Parser::OwningExprResult Parser::ParseBlockLiteralExpression() {
// If there was an error parsing the arguments, they may have
// tried to use ^(x+y) which requires an argument list. Just
// skip the whole block literal.
+ Actions.ActOnBlockError(CaretLoc, CurScope);
return ExprError();
}
// Inform sema that we are starting a block.
@@ -1364,6 +1365,7 @@ Parser::OwningExprResult Parser::ParseBlockLiteralExpression() {
if (!Tok.is(tok::l_brace)) {
// Saw something like: ^expr
Diag(Tok, diag::err_expected_expression);
+ Actions.ActOnBlockError(CaretLoc, CurScope);
return ExprError();
}