fix: was wrong with constants causing overflow

This commit is contained in:
ceriel 1988-07-07 15:02:47 +00:00
parent 5ff8baabfa
commit 8fc459e811

View file

@ -273,6 +273,12 @@ fill_int_expr(ex, ivalue, fund)
case INT:
ex->ex_type = int_type;
break;
case INTEGER:
if (ivalue >= 0 && ivalue <= max_int) {
ex->ex_type = int_type;
break;
}
/*FALL THROUGH*/
case LONG:
ex->ex_type =
(ivalue & (1L << (8*long_size - 1))) ? ulong_type
@ -296,11 +302,6 @@ fill_int_expr(ex, ivalue, fund)
) : uint_type
) : int_type;
break;
case INTEGER:
ex->ex_type = (ivalue <= max_int) ? int_type
: (ivalue & (1L << (8*long_size - 1))) ? ulong_type
: long_type;
break;
default:
crash("(intexpr) bad fund %s\n", symbol2str(fund));
}