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
Using the expression fuzzer, we have found a couple of compilation examples where FunC reports an overflow on expressions that would not produce an overflow if executed.
In fact, when such expressions are executed in the interpreter, the interpreter does not report an overflow and produces the correct result.
contract A {
get fun test(): Int {
// 2^256 - 45
let int1 = 115792089237316195423570985008687907853269984665640564039457584007913129639891;
// false case will execute, and it is less than 2^256-1
let res = (int1 != int1) ? (int1 + int1) : 33321583122581966542555556347793674561846130234625845898374435335324439320969;
return res;
}
}
contract A {
get fun test(): Int {
// 2^255
let int1 = 57896044618658097711785492504343953926634992332820282019728792003956564819968;
// true case will execute
let res = int1 == int1 ? int1 : int1 + int1;
return res;
}
}
This issue is related to div by zero issue #716, since that issue reports an example where FunC produces a div by zero error on an expression that would not produce a div by zero at runtime.
The text was updated successfully, but these errors were encountered:
Using the expression fuzzer, we have found a couple of compilation examples where FunC reports an overflow on expressions that would not produce an overflow if executed.
In fact, when such expressions are executed in the interpreter, the interpreter does not report an overflow and produces the correct result.
with error message:
And this other example:
with similar error message:
This issue is related to div by zero issue #716, since that issue reports an example where FunC produces a div by zero error on an expression that would not produce a div by zero at runtime.
The text was updated successfully, but these errors were encountered: