-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for assembly staticcall
#329
Comments
Cross referencing with openzeppelin-solidity 1761. It's possible this is fixed in solc |
Oh actually it looks like it was fixed in the new vm |
Fixed in |
Subsequently, the following hack in `BancorNetwork.sol` is no longer needed: /* SC0 */ if iszero(staticcall(gas, _dest, add(data, 32), mload(data), ret, 64)) {revert(0, 0)} // SC1 // switch call(gas, _dest, 0, add(data, 32), mload(data), ret, 64) case 0 {revert(0, 0)} // Prior to being instrumented by solidity-coverage, the SC0 line should be disabled and the SC1 line should be enabled: // - The `if` should be replaced with a `switch` because it would otherwise yield a compilation error (sc-forks/solidity-coverage#328) // - The `staticcall` should be replaced with a `call` because it would otherwise yield a runtime error (sc-forks/solidity-coverage#329)
@cgewecke: May I ask how it works? I've checked the instrumented contracts, and nothing in the related aspect seems to have changed. Here is the instrumented caller-function:
And here is the instrumented callee-function:
As you can see, the callee-function is (no longer) constant, so I don't quite understand how Thanks |
This utility in its current implementation fails upon testing a function which invokes any of the functions being tested (i.e., in any of the contracts being tested) via
staticcall
from anassembly
block.Here is the reason for this failure:
event
before each line of codestaticcall
, which was initially designated in order to invoke a constant function and retrieve its returned-value, fails silently (i.e., returns 0 without fetching the returned-value of the target function)The text was updated successfully, but these errors were encountered: