diff options
author | Chris Lattner <sabre@nondot.org> | 2008-05-27 23:32:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-05-27 23:32:43 +0000 |
commit | aec3a1eb215445e63ba5702f8d6b1e0f2e8c27b9 (patch) | |
tree | 71aea4b6e67ae82c4f86f2046e9b7e909a10f531 /lib/Parse/Parser.cpp | |
parent | 915e972098f1e67c7559613ccde7205cee582e61 (diff) |
Fix a couple crashes on invalid input.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 936604e870..2296f57afc 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -328,6 +328,7 @@ Parser::DeclTy *Parser::ParseExternalDeclaration() { if (!Result.isInvalid) return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(), Result.Val); + return 0; } case tok::at: // @ is not a legal token unless objc is enabled, no need to check. @@ -653,7 +654,7 @@ Parser::ExprResult Parser::ParseSimpleAsm() { if (Tok.isNot(tok::l_paren)) { Diag(Tok, diag::err_expected_lparen_after, "asm"); - return 0; + return true; } ConsumeParen(); |