forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnested_function.yul
56 lines (53 loc) · 1.01 KB
/
nested_function.yul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Test case to see if the step applies for nested functions. The function `j` has an unused argument.
{
sstore(f(1), 0)
sstore(h(1), 0)
function f(a) -> x
{
x := g(1)
x := add(x, 1)
function g(b) -> y
{
b := add(b, 1)
y := mload(b)
}
}
function h(c) -> u
{
u := j(c)
// d is unused
function j(d) -> w
{
w := 13
w := add(w, 1)
}
}
}
// ----
// step: unusedFunctionParameterPruner
//
// {
// sstore(f_1(1), 0)
// sstore(h(1), 0)
// function g(b) -> y
// {
// b := add(b, 1)
// y := mload(b)
// }
// function f() -> x
// {
// x := g(1)
// x := add(x, 1)
// }
// function f_1(a_3) -> x_4
// { x_4 := f() }
// function j() -> w
// {
// w := 13
// w := add(13, 1)
// }
// function j_2(d_5) -> w_6
// { w_6 := j() }
// function h(c) -> u
// { u := j_2(c) }
// }