You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// automatically generated from `func_test.fc`
DECLPROC calc
DECLPROC main
calc PROC:<{
DROP
TRUE
}>
main PROC:<{
256 PUSHNEGPOW2
calc CALLDICT
16 THROWIF
}>
Actual behavior when executed
calc always returns true.
Expected behavior when executed
Exit code 4, since x / -1 should produce an overflow when x = -115792089237316195423570985008687907853269984665640564039457584007913129639936 (i.e., x = MIN_INT).
Side note: We can produce a related but different expression that also gets mapped into TRUE by replacing the subexpression x / -1 for other expression that also produces overflows. For example, the following expressions also get transformed into TRUE in Fift, but they should produce error code 4 on the provided value for x:
((-1 * x) % 2) > -2 for x = MIN_INT.
((- x) % 2) > -2 for x = MIN_INT.
((x * 2) % 2) > -2 for x = MAX_INT (i.e., x = 115792089237316195423570985008687907853269984665640564039457584007913129639935).
((x + 1) % 2) > -2 for x = MAX_INT.
The text was updated successfully, but these errors were encountered:
Based on tact-lang/tact#3019
Code to reproduce
Output Fift
Actual behavior when executed
calc
always returnstrue
.Expected behavior when executed
Exit code 4, since
x / -1
should produce an overflow whenx = -115792089237316195423570985008687907853269984665640564039457584007913129639936
(i.e.,x = MIN_INT
).Side note: We can produce a related but different expression that also gets mapped into
TRUE
by replacing the subexpressionx / -1
for other expression that also produces overflows. For example, the following expressions also get transformed intoTRUE
in Fift, but they should produce error code 4 on the provided value forx
:((-1 * x) % 2) > -2
forx = MIN_INT
.((- x) % 2) > -2
forx = MIN_INT
.((x * 2) % 2) > -2
forx = MAX_INT
(i.e.,x = 115792089237316195423570985008687907853269984665640564039457584007913129639935
).((x + 1) % 2) > -2
forx = MAX_INT
.The text was updated successfully, but these errors were encountered: