From 04a9a18862f5b34d6e32769452c243105accb44b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 10 Jun 2013 17:58:31 +0300 Subject: [PATCH] extra: revert part of the recurse patch which broke smatch_equiv I removed the is_simple_math() check when I introduced has_variable() because it seemed like it was cut and pasted from earlier. But actually it turns out to be needed and basically correct. Without the check then smatch_extra was duplicating part of what smatch_equiv does and this created bugs. Signed-off-by: Dan Carpenter --- smatch_extra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smatch_extra.c b/smatch_extra.c index 6b886062..80b36bb1 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -1108,7 +1108,7 @@ static void match_comparison(struct expression *expr) handle_comparison(type, left, expr->op, right); prev = get_assigned_expr(left_orig); - if (prev && has_variable(prev, left_orig) == 0) { + if (is_simple_math(prev) && has_variable(prev, left_orig) == 0) { left = prev; right = right_orig; move_known_values(&left, &right); @@ -1116,7 +1116,7 @@ static void match_comparison(struct expression *expr) } prev = get_assigned_expr(right_orig); - if (prev && has_variable(prev, right_orig) == 0) { + if (is_simple_math(prev) && has_variable(prev, right_orig) == 0) { left = left_orig; right = prev; move_known_values(&left, &right); -- 2.11.4.GIT