fix: was wrong with constants causing overflow
This commit is contained in:
parent
5ff8baabfa
commit
8fc459e811
1 changed files with 6 additions and 5 deletions
|
@ -273,6 +273,12 @@ fill_int_expr(ex, ivalue, fund)
|
||||||
case INT:
|
case INT:
|
||||||
ex->ex_type = int_type;
|
ex->ex_type = int_type;
|
||||||
break;
|
break;
|
||||||
|
case INTEGER:
|
||||||
|
if (ivalue >= 0 && ivalue <= max_int) {
|
||||||
|
ex->ex_type = int_type;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/*FALL THROUGH*/
|
||||||
case LONG:
|
case LONG:
|
||||||
ex->ex_type =
|
ex->ex_type =
|
||||||
(ivalue & (1L << (8*long_size - 1))) ? ulong_type
|
(ivalue & (1L << (8*long_size - 1))) ? ulong_type
|
||||||
|
@ -296,11 +302,6 @@ fill_int_expr(ex, ivalue, fund)
|
||||||
) : uint_type
|
) : uint_type
|
||||||
) : int_type;
|
) : int_type;
|
||||||
break;
|
break;
|
||||||
case INTEGER:
|
|
||||||
ex->ex_type = (ivalue <= max_int) ? int_type
|
|
||||||
: (ivalue & (1L << (8*long_size - 1))) ? ulong_type
|
|
||||||
: long_type;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
crash("(intexpr) bad fund %s\n", symbol2str(fund));
|
crash("(intexpr) bad fund %s\n", symbol2str(fund));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue