From 26575b3f9a6964851ccacfeb36f93e9578814e3a Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 2 Aug 2009 16:18:13 +0200 Subject: [PATCH] return UNDEFINED. Gar... This needs a proper cleanup to refer to long long through out instead of int. For now I'm doing this tmp patch. Signed-off-by: Dan Carpenter --- smatch_extra.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/smatch_extra.c b/smatch_extra.c index 99a7b632..f15678b8 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -336,7 +336,7 @@ static void match_function_def(struct symbol *sym) #define VAL_MAX 1 #define VAL_MIN 2 -static int get_implied_value_helper(struct expression *expr, int what) +static long long get_implied_value_helper(struct expression *expr, int what) { struct smatch_state *state; int val; @@ -368,12 +368,22 @@ int get_implied_single_val(struct expression *expr) int get_implied_max(struct expression *expr) { - return get_implied_value_helper(expr, VAL_MAX); + long long ret; + + ret = get_implied_value_helper(expr, VAL_MAX); + if (ret == whole_range.max) + return UNDEFINED; + return ret; } int get_implied_min(struct expression *expr) { - return get_implied_value_helper(expr, VAL_MIN); + long long ret; + + ret = get_implied_value_helper(expr, VAL_MIN); + if (ret == whole_range.min) + return UNDEFINED; + return ret; } int last_stmt_val(struct statement *stmt) -- 2.11.4.GIT