math: overflow implies that there is no fuzzy max
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 26 Nov 2012 08:19:23 +0000 (26 11:19 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 26 Nov 2012 08:19:23 +0000 (26 11:19 +0300)
If you do a binop that overflows, by definition that means that there isn't
a fuzzy max for it.

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

index 6e57a3d..fe76e96 100644 (file)
@@ -283,12 +283,12 @@ static sval_t handle_binop(struct expression *expr, int *undefined, int implied)
 
        switch (implied) {
        case IMPLIED_MAX:
-       case FUZZY_MAX:
        case ABSOLUTE_MAX:
                if (sval_binop_overflows(left, expr->op, right))
                        return sval_type_max(get_type(expr));
                break;
        case HARD_MAX:
+       case FUZZY_MAX:
                if (sval_binop_overflows(left, expr->op, right)) {
                        *undefined = 1;
                        return bogus;