From c8083b727d5df89f604aabc87491f86115abee63 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 10 Jan 2017 17:47:27 +0300 Subject: [PATCH] implied: fix a bug handling parameter implications I did this before the Christmas vacation... I think the bug is a type issue where we want to convert the type in separate_and_filter(). Anyway, it doesn't make sense to take the intersection here. Signed-off-by: Dan Carpenter --- smatch_implied.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/smatch_implied.c b/smatch_implied.c index 18e5a972..223bd5fd 100644 --- a/smatch_implied.c +++ b/smatch_implied.c @@ -856,7 +856,7 @@ void param_limit_implications(struct expression *expr, int param, char *key, cha struct sm_state *tmp; struct stree *implied_true = NULL; struct stree *implied_false = NULL; - struct range_list *orig, *limit, *rl; + struct range_list *orig, *limit; while (expr->type == EXPR_ASSIGNMENT) expr = strip_expr(expr->right); @@ -884,9 +884,8 @@ void param_limit_implications(struct expression *expr, int param, char *key, cha orig = cast_rl(compare_type, orig); call_results_to_rl(expr, compare_type, value, &limit); - rl = rl_intersection(orig, limit); - separate_and_filter(sm, SPECIAL_EQUAL, rl, __get_cur_stree(), &implied_true, &implied_false, NULL); + separate_and_filter(sm, SPECIAL_EQUAL, limit, __get_cur_stree(), &implied_true, &implied_false, NULL); FOR_EACH_SM(implied_true, tmp) { __set_sm_fake_stree(tmp); -- 2.11.4.GIT