From d541b69a5bb17ad27c120fc1504c4003542618e1 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 15 Mar 2013 23:04:19 +0300 Subject: [PATCH] extra: type bug handling asm expressions This is a theoretical bug more than anything. If the variable is casted then we care about the uncasted type more than the casted version. Signed-off-by: Dan Carpenter --- smatch_extra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smatch_extra.c b/smatch_extra.c index e4769010..293b18a6 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -662,6 +662,7 @@ static void asm_expr(struct statement *stmt) { struct expression *expr; + struct symbol *type; int state = 0; FOR_EACH_PTR(stmt->asm_outputs, expr) { @@ -672,7 +673,8 @@ static void asm_expr(struct statement *stmt) continue; case 2: /* expression */ state = 0; - set_extra_expr_mod(expr, alloc_estate_whole(get_type(expr))); + type = get_type(strip_expr(expr)); + set_extra_expr_mod(expr, alloc_estate_whole(type)); continue; } } END_FOR_EACH_PTR(expr); -- 2.11.4.GIT