2018-10-16 15:29:20 +00:00
|
|
|
{
|
|
|
|
// This is a test for an older version where
|
|
|
|
// inlining was performed on a function
|
|
|
|
// just being called. This is a problem
|
|
|
|
// because the statemenst of the original
|
|
|
|
// function might be in an invalid state.
|
|
|
|
|
|
|
|
function f(x) {
|
|
|
|
mstore(0, x)
|
|
|
|
mstore(7, h())
|
|
|
|
g(10)
|
|
|
|
mstore(1, x)
|
|
|
|
}
|
|
|
|
function g(x) {
|
|
|
|
f(1)
|
|
|
|
}
|
|
|
|
function h() -> t {
|
|
|
|
t := 2
|
|
|
|
|
|
|
|
}
|
|
|
|
{
|
|
|
|
f(100)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ----
|
|
|
|
// fullInliner
|
|
|
|
// {
|
|
|
|
// {
|
2019-01-08 14:03:40 +00:00
|
|
|
// let f_x := 100
|
|
|
|
// mstore(0, f_x)
|
|
|
|
// mstore(7, h())
|
|
|
|
// g(10)
|
|
|
|
// mstore(1, f_x)
|
2018-10-16 15:29:20 +00:00
|
|
|
// }
|
|
|
|
// function f(x)
|
|
|
|
// {
|
|
|
|
// mstore(0, x)
|
2018-12-13 14:38:14 +00:00
|
|
|
// let h_t := 0
|
2018-10-16 15:29:20 +00:00
|
|
|
// h_t := 2
|
|
|
|
// mstore(7, h_t)
|
2018-10-16 15:21:14 +00:00
|
|
|
// let g_x_1 := 10
|
2018-11-09 19:21:26 +00:00
|
|
|
// let g_f_x_8 := 1
|
|
|
|
// mstore(0, g_f_x_8)
|
|
|
|
// mstore(7, h())
|
|
|
|
// g(10)
|
|
|
|
// mstore(1, g_f_x_8)
|
2018-10-16 15:29:20 +00:00
|
|
|
// mstore(1, x)
|
|
|
|
// }
|
|
|
|
// function g(x_1)
|
|
|
|
// {
|
2018-11-07 18:27:15 +00:00
|
|
|
// let f_x_8 := 1
|
|
|
|
// mstore(0, f_x_8)
|
2018-11-09 19:21:26 +00:00
|
|
|
// mstore(7, h())
|
|
|
|
// g(10)
|
2018-11-07 18:27:15 +00:00
|
|
|
// mstore(1, f_x_8)
|
2018-10-16 15:29:20 +00:00
|
|
|
// }
|
|
|
|
// function h() -> t
|
|
|
|
// {
|
|
|
|
// t := 2
|
|
|
|
// }
|
|
|
|
// }
|