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
function f(uint256b) privatereturns (uint256) {
b = b / b;
}
CHC cannot detect "divide by 0" counterexample.
Given a public member function in a contract such as
contractC {
function g(uint256b) publicreturns (uint256) {
return b = b / b;
}
}
the output of CHC contains errors, such as
Warning: CHC: Division by zero happens here.
Counterexample:
b = 0
= 0
Transaction trace:
C.constructor()
C.g(0)
--> test2.sol:16:16:
|
16 | return b = b / b;
| ^^^^^
In the above warning message given by CHC, = 0 is misleading.
Environment
Compiler version:0.8.28
Operating system: macos
Steps to Reproduce
Here is a reproducible test program
function f(uint8b) {
uint16 a = b;
a = a / a;
}
function g(uint8b) {
b = b / b;
}
contractC {
function f(uint256b) privatereturns (uint256) {
b = b / b;
}
function g(uint256b) publicreturns (uint256) {
return b = b / b;
}
}
The text was updated successfully, but these errors were encountered:
Description
or a member function such as
CHC cannot detect "divide by 0" counterexample.
the output of CHC contains errors, such as
In the above warning message given by CHC,
= 0
is misleading.Environment
Steps to Reproduce
Here is a reproducible test program
The text was updated successfully, but these errors were encountered: