From 9a9e30d71f9fe780d54353178d5f052534052f5b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 20 May 2013 18:46:26 +0300 Subject: [PATCH] math: create handle_call_rl() handle_call() is another layering violation. The actual logic was in get_implied_rl(). I have created a duplicate for now and will clean up later. Signed-off-by: Dan Carpenter --- smatch_math.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/smatch_math.c b/smatch_math.c index 68847eef..14183e7f 100644 --- a/smatch_math.c +++ b/smatch_math.c @@ -779,6 +779,18 @@ static sval_t handle_sizeof(struct expression *expr) return ret; } +static struct range_list *handle_call_rl(struct expression *expr, int implied) +{ + struct range_list *rl; + + if (implied == EXACT) + return NULL; + + if (get_implied_return(expr, &rl)) + return rl; + return db_return_vals(expr); +} + static sval_t handle_call(struct expression *expr, int *undefined, int implied) { struct range_list *rl; @@ -859,7 +871,11 @@ static struct range_list *_get_rl(struct expression *expr, int implied) sval = handle_conditional(expr, &undefined, implied); break; case EXPR_CALL: - sval = handle_call(expr, &undefined, implied); + rl = handle_call_rl(expr, implied); + if (rl) + return rl; + else + undefined = 1; break; default: rl = handle_variable(expr, implied); -- 2.11.4.GIT