mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Print warning for unnamed return parameters and no return statement
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user