propagate: fall out from get_implied_min() changes
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Feb 2013 08:54:20 +0000 (6 11:54 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Feb 2013 08:54:20 +0000 (6 11:54 +0300)
It used to be that if the min was s32min then get_implied_min() failed but
now we've changed that.  check_propaget.c needs to have its own check for
sval_is_min() instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_propagate.c

index 7be5a76..0e236ee 100644 (file)
@@ -53,7 +53,7 @@ static void match_return(struct expression *ret_value)
                return;
        if (!get_implied_max(last_return, &lret) || lret.value >= 0)
                return;
-       if (get_implied_min(last_return, &lret))
+       if (get_implied_min(last_return, &lret) && !sval_is_min(lret))
                return;
        name = expr_to_var(last_return);
        sm_msg("info: why not propagate '%s' from %s() instead of %s?",