зеркало из https://github.com/microsoft/clang-1.git
Fix a couple crashes on invalid input.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
915e972098
Коммит
aec3a1eb21
|
@ -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();
|
||||
|
|
|
@ -8,3 +8,8 @@ void f2() {
|
|||
asm("foo" : "=r" (a)); // expected-error {{use of undeclared identifier 'a'}}
|
||||
asm("foo" : : "r" (b)); // expected-error {{use of undeclared identifier 'b'}}
|
||||
}
|
||||
|
||||
|
||||
// rdar://5952468
|
||||
__asm ; // expected-error {{expected '(' after 'asm'}}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче