Tests for FunctionSpecializer

This commit is contained in:
hrkrshnn
2021-03-29 11:02:18 +02:00
parent 45a3747701
commit 09998ceb0c
23 changed files with 3923 additions and 424 deletions
@@ -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(_1)
let memPos := allocate_memory()
return(memPos, sub(abi_encode_uint256(memPos, var_sum), memPos))
}
}
@@ -51,17 +51,16 @@ object "Arraysum_34" {
tail := add(headStart, 32)
mstore(headStart, value0)
}
function allocate_memory(size) -> memPtr
function allocate_memory() -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
if gt(memPtr, 0xffffffffffffffff)
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
mstore(64, newFreePtr)
mstore(64, memPtr)
}
function checked_add_uint256(x, y) -> sum
{