mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Handle "leaf functions" first in full inliner.
This commit is contained in:
@@ -33,11 +33,14 @@ object "Arraysum_33" {
|
||||
for { }
|
||||
lt(vloc_i, _2)
|
||||
{
|
||||
vloc_i := increment_t_uint256(vloc_i)
|
||||
if gt(vloc_i, not(1)) { revert(_1, _1) }
|
||||
vloc_i := add(vloc_i, 1)
|
||||
}
|
||||
{
|
||||
let _3, _4 := storage_array_index_access$_t_uint256_$dyn_storage(_1, vloc_i)
|
||||
vloc_sum := checked_add_t_uint256(vloc_sum, extract_from_storage_value_dynamict_uint256(sload(_3), _4))
|
||||
mstore(_1, _1)
|
||||
let _3 := sload(add(keccak256(_1, 0x20), vloc_i))
|
||||
if gt(vloc_sum, not(_3)) { revert(_1, _1) }
|
||||
vloc_sum := add(vloc_sum, _3)
|
||||
}
|
||||
let memPos := allocateMemory(_1)
|
||||
return(memPos, sub(abi_encode_uint(memPos, _1), memPos))
|
||||
@@ -57,27 +60,6 @@ object "Arraysum_33" {
|
||||
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { revert(0, 0) }
|
||||
mstore(64, newFreePtr)
|
||||
}
|
||||
function checked_add_t_uint256(x, y) -> sum
|
||||
{
|
||||
if gt(x, not(y)) { revert(sum, sum) }
|
||||
sum := add(x, y)
|
||||
}
|
||||
function extract_from_storage_value_dynamict_uint256(slot_value, offset) -> value
|
||||
{
|
||||
value := shr(mul(offset, 8), slot_value)
|
||||
}
|
||||
function increment_t_uint256(value) -> ret
|
||||
{
|
||||
if gt(value, not(1)) { revert(ret, ret) }
|
||||
ret := add(value, 1)
|
||||
}
|
||||
function storage_array_index_access$_t_uint256_$dyn_storage(array, index) -> slot, offset
|
||||
{
|
||||
if iszero(lt(index, sload(array))) { invalid() }
|
||||
mstore(slot, array)
|
||||
slot := add(keccak256(slot, 0x20), index)
|
||||
offset := offset
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user