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
// 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.
if (!Tok.is(tok::l_brace)) {
// Saw something like: ^expr
Diag(Tok, diag::err_expected_expression);
+ Actions.ActOnBlockError(CaretLoc, CurScope);
return ExprError();
}
PopDeclContext();
// Verify and clean out per-function state.
- //assert(&getLabelMap() == &FunctionLabelMap && "Didn't pop block right?");
+ assert(&getLabelMap() == &FunctionLabelMap && "Didn't pop block right?");
bool HaveLabels = !FunctionLabelMap.empty();
// Check goto/label use.