From d36f58de0aae91b09f692104439a650983df7eac Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 17 Nov 2012 16:42:14 +0300 Subject: [PATCH] flow: hooks: fix MACRO_ASSIGNMENT_HOOK The old logic passed the assignment if an assignment took place inside a macro. What we want are places where a macro is assigned to a variable. Signed-off-by: Dan Carpenter --- smatch_flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smatch_flow.c b/smatch_flow.c index e2d8cfc1..2ede12e4 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -158,7 +158,8 @@ void __split_expr(struct expression *expr) tmp = strip_expr(expr->right); if (tmp->type == EXPR_CALL) __pass_to_client(expr, CALL_ASSIGNMENT_HOOK); - if (get_macro_name(tmp->pos)) + if (get_macro_name(tmp->pos) && + get_macro_name(expr->pos) != get_macro_name(tmp->pos)) __pass_to_client(expr, MACRO_ASSIGNMENT_HOOK); __split_expr(expr->left); break; -- 2.11.4.GIT