return
is incorrectly used in assembly mode SLITHER-W1023Detect if return
in an assembly block halts unexpectedly the execution.
contract C {
function f() internal returns (uint a, uint b) {
assembly {
return (5, 6)
}
}
function g() returns (bool){
f();
return true;
}
}
The return statement in f
will cause execution in g
to halt.
The function will return 6 bytes starting from offset 5, instead of returning a boolean.
Use the leave
statement.
incorrect-return on Slither's wiki.