ParseCompoundStatement() currently never returns StmtError, but if it did,
Sema would keep the __finally scope on its stack indefinitely. Explicitly
add an error callback that clears it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231625
91177308-0d34-0410-b5e6-
96231b3b80d8
Expr *FilterExpr,
Stmt *Block);
void ActOnStartSEHFinallyBlock();
+ void ActOnAbortSEHFinallyBlock();
StmtResult ActOnFinishSEHFinallyBlock(SourceLocation Loc, Stmt *Block);
StmtResult ActOnSEHLeaveStmt(SourceLocation Loc, Scope *CurScope);
Actions.ActOnStartSEHFinallyBlock();
StmtResult Block(ParseCompoundStatement());
- if(Block.isInvalid())
+ if(Block.isInvalid()) {
+ Actions.ActOnAbortSEHFinallyBlock();
return Block;
+ }
return Actions.ActOnFinishSEHFinallyBlock(FinallyLoc, Block.get());
}
CurrentSEHFinally.push_back(CurScope);
}
+void Sema::ActOnAbortSEHFinallyBlock() {
+ CurrentSEHFinally.pop_back();
+}
+
StmtResult Sema::ActOnFinishSEHFinallyBlock(SourceLocation Loc, Stmt *Block) {
assert(Block);
CurrentSEHFinally.pop_back();