From 8728a8dd802d50c9a33ca1901676a5acce172326 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 22 Sep 2011 15:42:11 +0300 Subject: [PATCH] flow: tweak the ->pos setting for fake assignments Fake assignments are used so that clients can just get treat initializers like a normal assignment if they want to. This changes the position of the fake assignment expression so that it's at position 'A' instead of position 'B' in the diagram below. foo = bar; ^ ^ A B Signed-off-by: Dan Carpenter --- smatch_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smatch_flow.c b/smatch_flow.c index 2fd6a32e..67a3a8f0 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -694,7 +694,7 @@ static struct expression *fake_assign_expr(struct symbol *sym) struct expression *e_assign, *e_symbol; e_assign = alloc_expression(sym->initializer->pos, EXPR_ASSIGNMENT); - e_symbol = alloc_expression(sym->initializer->pos, EXPR_SYMBOL); + e_symbol = alloc_expression(sym->pos, EXPR_SYMBOL); e_assign->op = (int)'='; e_symbol->symbol = sym; e_symbol->symbol_name = sym->ident; -- 2.11.4.GIT