Print warning for unnamed return parameters and no return statement

This commit is contained in:
Mathias Baumann
2020-10-13 13:11:29 +02:00
parent abfa136afb
commit 32b4f18023
54 changed files with 139 additions and 31 deletions
@@ -4,8 +4,8 @@ pragma solidity >=0.0;
contract Arraysum {
uint256[] values;
function sumArray() public view returns(uint) {
uint sum = 0;
function sumArray() public view returns(uint sum) {
sum = 0;
// The optimizer should read the length of the array only once, because
// LoopInvariantCodeMotion can move the `sload` corresponding to the length outside of the
// loop.
@@ -43,7 +43,7 @@ object "Arraysum_33" {
vloc_sum := add(vloc_sum, _3)
}
let memPos := allocateMemory(_1)
return(memPos, sub(abi_encode_uint(memPos, _1), memPos))
return(memPos, sub(abi_encode_uint(memPos, vloc_sum), memPos))
}
}
revert(0, 0)