Use unbounded allocation before returning.

This commit is contained in:
Daniel Kirchner
2021-04-08 18:37:24 +02:00
parent c060bd5633
commit 96c8123b6b
135 changed files with 200 additions and 393 deletions
+1 -12
View File
@@ -40,7 +40,7 @@ object "Arraysum_34" {
mstore(_1, _1)
var_sum := checked_add_uint256(var_sum, sload(add(keccak256(_1, 0x20), var_i)))
}
let memPos := allocate_memory()
let memPos := mload(64)
return(memPos, sub(abi_encode_uint256(memPos, var_sum), memPos))
}
}
@@ -51,17 +51,6 @@ object "Arraysum_34" {
tail := add(headStart, 32)
mstore(headStart, value0)
}
function allocate_memory() -> memPtr
{
memPtr := mload(64)
if gt(memPtr, 0xffffffffffffffff)
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
mstore(64, memPtr)
}
function checked_add_uint256(x, y) -> sum
{
if gt(x, not(y)) { panic_error_0x11() }