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:<{
0 PUSHINT
calc CALLDICT
16 THROWIF
}>
Actual behavior when executed
calc always returns true.
Expected behavior when executed
Exit code 4, since 0 / x should produce a division by zero when x = 0.
Side note 1: We can produce a related expression that also gets mapped into TRUE by replacing 0 with other expression that is equal to 0. 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) >= 0 for x = 0.
((1 & (~ 1)) / x) >= 0 for x = 0.
((x & 0) / x) >= 0 for x = 0.
((x * 0) / x) >= 0 for x = 0.
Side note 2: The related expression (0 / x) == 0 DOES get translated to Fift in the expected way:
calc PROC:<{
0 PUSHINT
SWAP
DIV
0 EQINT
}>
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
0 / x
should produce a division by zero whenx = 0
.Side note 1: We can produce a related expression that also gets mapped into
TRUE
by replacing0
with other expression that is equal to0
. 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) >= 0
forx = 0
.((1 & (~ 1)) / x) >= 0
forx = 0
.((x & 0) / x) >= 0
forx = 0
.((x * 0) / x) >= 0
forx = 0
.Side note 2: The related expression
(0 / x) == 0
DOES get translated to Fift in the expected way:The text was updated successfully, but these errors were encountered: