From 31c69d43a0fcd04b5691b7bfd4204963c288af36 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 20 May 2013 16:35:54 +0300 Subject: [PATCH] math: move absolute min/max code from _get_value() to _get_rl() Eventually _get_value() will be totall replaced by _get_rl(). Signed-off-by: Dan Carpenter --- smatch_math.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/smatch_math.c b/smatch_math.c index 11790a98..088db000 100644 --- a/smatch_math.c +++ b/smatch_math.c @@ -749,11 +749,17 @@ static sval_t handle_call(struct expression *expr, int *undefined, int implied) static struct range_list *_get_rl(struct expression *expr, int implied) { struct range_list *rl; + struct symbol *type; int undefined; sval_t sval; + type = get_type(expr); undefined = 0; sval = _get_value(expr, &undefined, implied); + + if (undefined && type && + (implied == ABSOLUTE_MAX || implied == ABSOLUTE_MIN)) + return alloc_whole_rl(type); if (undefined) return NULL; rl = alloc_rl(sval, sval); @@ -820,14 +826,6 @@ static sval_t _get_value(struct expression *expr, int *undefined, int implied) default: ret = _get_implied_value(expr, undefined, implied); } - if (*undefined && type && implied == ABSOLUTE_MAX) { - *undefined = 0; - ret = sval_type_max(type); - } - if (*undefined && type && implied == ABSOLUTE_MIN) { - *undefined = 0; - ret = sval_type_min(type); - } if (*undefined) return bogus; -- 2.11.4.GIT