diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2015-03-09 03:17:15 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2015-03-09 03:17:15 +0000 |
| commit | ce90329824037c89af64a5ee852e4c86f0c62cc7 (patch) | |
| tree | 69257a102a93ca8f330c72f704bef52722df4ca3 /clang/lib/Parse | |
| parent | 75eda5e913d9fb9539ba79dba625bc98fe91ad31 (diff) | |
| download | bcm5719-llvm-ce90329824037c89af64a5ee852e4c86f0c62cc7.tar.gz bcm5719-llvm-ce90329824037c89af64a5ee852e4c86f0c62cc7.zip | |
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
Diffstat (limited to 'clang/lib/Parse')
| -rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index 9028e4ac2dd..27c757b5081 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -519,8 +519,10 @@ StmtResult Parser::ParseSEHFinallyBlock(SourceLocation FinallyLoc) { Actions.ActOnStartSEHFinallyBlock(); StmtResult Block(ParseCompoundStatement()); - if(Block.isInvalid()) + if(Block.isInvalid()) { + Actions.ActOnAbortSEHFinallyBlock(); return Block; + } return Actions.ActOnFinishSEHFinallyBlock(FinallyLoc, Block.get()); } |

