aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-06-10 10:33:30 +0200
committerChristopher Li <sparse@chrisli.org>2010-06-17 17:21:10 -0700
commit7ccc8abebad14639c22549cf55193e50b728802f (patch)
tree943721a43840fdc71f50b351f9bb3f00a0bcc6ca /evaluate.c
parentAdding asm goto label test case (diff)
downloadsparse-7ccc8abebad14639c22549cf55193e50b728802f.tar.gz
sparse-7ccc8abebad14639c22549cf55193e50b728802f.tar.bz2
sparse-7ccc8abebad14639c22549cf55193e50b728802f.zip
parser: add support for asm goto
As of gcc 4.5, asm goto("jmp %l[label]" : OUT : IN : CLOB : LABELS) is supported. Add this support to the parser so that it won't choke on the newest Linux kernel when compiling with gcc 4.5. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index cdbd064..f8343c2 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -3151,6 +3151,7 @@ static void verify_input_constraint(struct expression *expr, const char *constra
static void evaluate_asm_statement(struct statement *stmt)
{
struct expression *expr;
+ struct symbol *sym;
int state;
expr = stmt->asm_string;
@@ -3227,6 +3228,13 @@ static void evaluate_asm_statement(struct statement *stmt)
continue;
expression_error(expr, "asm clobber is not a string");
} END_FOR_EACH_PTR(expr);
+
+ FOR_EACH_PTR(stmt->asm_labels, sym) {
+ if (!sym || sym->type != SYM_LABEL) {
+ sparse_error(stmt->pos, "bad asm label");
+ return;
+ }
+ } END_FOR_EACH_PTR(sym);
}
static void evaluate_case_statement(struct statement *stmt)