diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-15 10:42:39 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-15 10:42:39 -0700 |
| commit | ba1f7076aeb9c9e8dd2542eddbcc667a9b0e1208 (patch) | |
| tree | 345b754670772f7eb19b8b74236b37596f08aebf | |
| parent | 3ceaafeaea1d2d4ee4c1a7f3356e25ba9b1af815 (diff) | |
| download | sparse-dev-ba1f7076aeb9c9e8dd2542eddbcc667a9b0e1208.tar.gz | |
Fix parsing of top-level asm statements
This also simplifies the code - don't bother to make it look like a real
function.
Bug pointed out by Oleg Nesterov.
| -rw-r--r-- | parse.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -1660,18 +1660,16 @@ struct token *external_declaration(struct token *token, struct symbol_list **lis /* Top-level inline asm? */ if (match_idents(token, &asm_ident, &__asm___ident, &__asm_ident, NULL)) { - struct symbol_list **old_symbol_list; struct symbol *anon = alloc_symbol(token->pos, SYM_NODE); struct symbol *fn = alloc_symbol(token->pos, SYM_FN); struct statement *stmt; anon->ctype.base_type = fn; - old_symbol_list = function_symbol_list; - function_symbol_list = &anon->symbol_list; - stmt = start_function(anon); + stmt = alloc_statement(token->pos, STMT_NONE); + fn->stmt = stmt; + token = parse_asm(token->next, stmt); - end_function(anon); - function_symbol_list = old_symbol_list; + add_symbol(list, anon); return token; } |
