Fix a theoretical bug when ParseCompoundStatement() returns StmtError.
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.
llvm-svn: 231625
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 9028e4a..27c757b 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -519,8 +519,10 @@
Actions.ActOnStartSEHFinallyBlock();
StmtResult Block(ParseCompoundStatement());
- if(Block.isInvalid())
+ if(Block.isInvalid()) {
+ Actions.ActOnAbortSEHFinallyBlock();
return Block;
+ }
return Actions.ActOnFinishSEHFinallyBlock(FinallyLoc, Block.get());
}