solidity/test/libyul/yulOptimizerTests/stackLimitEvader/stub.yul

99 lines
3.1 KiB
Plaintext
Raw Normal View History

2020-07-02 10:48:20 +00:00
{
{
mstore(0x40, memoryguard(128))
sstore(g(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), f())
}
function g(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16) -> v {
// Should be, but cannot yet be escalated.
v := b16
}
function f() -> v{
let a1 := calldataload(mul(1,4))
let a2 := calldataload(mul(2,4))
let a3 := calldataload(mul(3,4))
let a4 := calldataload(mul(4,4))
let a5 := calldataload(mul(5,4))
let a6 := calldataload(mul(6,4))
let a7 := calldataload(mul(7,4))
let a8 := calldataload(mul(8,4))
let a9 := calldataload(mul(9,4))
a1 := calldataload(mul(0,4))
let a10 := calldataload(mul(10,4))
let a11 := calldataload(mul(11,4))
let a12 := calldataload(mul(12,4))
let a13 := calldataload(mul(13,4))
let a14 := calldataload(mul(14,4))
let a15 := calldataload(mul(15,4))
let a16 := calldataload(mul(16,4))
let a17 := calldataload(mul(17,4))
sstore(0, a1)
sstore(mul(17,4), a17)
sstore(mul(16,4), a16)
sstore(mul(15,4), a15)
sstore(mul(14,4), a14)
sstore(mul(13,4), a13)
sstore(mul(12,4), a12)
sstore(mul(11,4), a11)
sstore(mul(10,4), a10)
sstore(mul(9,4), a9)
sstore(mul(8,4), a8)
sstore(mul(7,4), a7)
sstore(mul(6,4), a6)
sstore(mul(5,4), a5)
sstore(mul(4,4), a4)
sstore(mul(3,4), a3)
sstore(mul(2,4), a2)
sstore(mul(1,4), a1)
}
}
// ----
// step: stackLimitEvader
//
// {
// {
// mstore(0x40, memoryguard(0xa0))
// sstore(g(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), f())
// }
// function g(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16) -> v
// { v := b16 }
// function f() -> v_1
// {
// mstore(0x80, calldataload(mul(1, 4)))
// let a2 := calldataload(mul(2, 4))
// let a3 := calldataload(mul(3, 4))
// let a4 := calldataload(mul(4, 4))
// let a5 := calldataload(mul(5, 4))
// let a6 := calldataload(mul(6, 4))
// let a7 := calldataload(mul(7, 4))
// let a8 := calldataload(mul(8, 4))
// let a9 := calldataload(mul(9, 4))
// mstore(0x80, calldataload(mul(0, 4)))
// let a10 := calldataload(mul(10, 4))
// let a11 := calldataload(mul(11, 4))
// let a12 := calldataload(mul(12, 4))
// let a13 := calldataload(mul(13, 4))
// let a14 := calldataload(mul(14, 4))
// let a15 := calldataload(mul(15, 4))
// let a16 := calldataload(mul(16, 4))
// let a17 := calldataload(mul(17, 4))
// sstore(0, mload(0x80))
// sstore(mul(17, 4), a17)
// sstore(mul(16, 4), a16)
// sstore(mul(15, 4), a15)
// sstore(mul(14, 4), a14)
// sstore(mul(13, 4), a13)
// sstore(mul(12, 4), a12)
// sstore(mul(11, 4), a11)
// sstore(mul(10, 4), a10)
// sstore(mul(9, 4), a9)
// sstore(mul(8, 4), a8)
// sstore(mul(7, 4), a7)
// sstore(mul(6, 4), a6)
// sstore(mul(5, 4), a5)
// sstore(mul(4, 4), a4)
// sstore(mul(3, 4), a3)
// sstore(mul(2, 4), a2)
// sstore(mul(1, 4), mload(0x80))
// }
// }