Merge pull request #9038 from ethereum/develop

Merge develop into breaking.
This commit is contained in:
chriseth
2020-05-27 15:24:27 +02:00
committed by GitHub
116 changed files with 1424 additions and 582 deletions
+27 -14
View File
@@ -45,7 +45,7 @@ object "object" {
Binary representation:
0061736d0100000001160460000060017e017e60057e7e7e7e7e0060027f7f0002190108657468657265756d0c73746f7261676553746f7265000303060500010101020503010001060100071102066d656d6f72790200046d61696e00010abe01052801017e420021004200200020002000200010054220200020002000420110054200a74220a710000b1c01017e20004208864280fe0383200042088842ff018384210120010b1b01027e20001002421086210220022000421088100284210120010b1b01027e20001003422086210220022000422088100384210120010b3e01007e2000a7200110043703002000a74208a76aada7200210043703002000a74210a76aada7200310043703002000a74218a76aada7200410043703000b
0061736d0100000001160460000060017e017e60057e7e7e7e7e0060027f7f0002190108657468657265756d0c73746f7261676553746f7265000303060500010101020503010001060100071102066d656d6f72790200046d61696e00010acd01052b01017e0240420021004200200020002000200010054220200020002000420110054200a74220a710000b0b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100242108621022002200042108810028421010b20010b1e01027e02402000100342208621022002200042208810038421010b20010b4101007e02402000a7200110043703002000a74208a76aada7200210043703002000a74210a76aada7200310043703002000a74218a76aada7200410043703000b0b
Text representation:
(module
@@ -55,17 +55,22 @@ Text representation:
(func $main
(local $_1 i64)
(local.set $_1 (i64.const 0))
(call $mstore_internal (i64.const 0) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))
(call $mstore_internal (i64.const 32) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 1))
(call $eth.storageStore (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 32)))
(block $label_
(local.set $_1 (i64.const 0))
(call $mstore_internal (i64.const 0) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))
(call $mstore_internal (i64.const 32) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 1))
(call $eth.storageStore (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 32)))
)
)
(func $endian_swap_16
(param $x i64)
(result i64)
(local $y i64)
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
(block $label__1
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
)
(local.get $y)
)
@@ -74,8 +79,11 @@ Text representation:
(result i64)
(local $y i64)
(local $hi i64)
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
(block $label__2
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
)
(local.get $y)
)
@@ -84,8 +92,11 @@ Text representation:
(result i64)
(local $y i64)
(local $hi i64)
(local.set $hi (i64.shl (call $endian_swap_32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $x) (i64.const 32)))))
(block $label__3
(local.set $hi (i64.shl (call $endian_swap_32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $x) (i64.const 32)))))
)
(local.get $y)
)
@@ -95,10 +106,12 @@ Text representation:
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(i64.store (i32.wrap_i64 (local.get $pos)) (call $endian_swap (local.get $y1)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 8))))) (call $endian_swap (local.get $y2)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 16))))) (call $endian_swap (local.get $y3)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 24))))) (call $endian_swap (local.get $y4)))
(block $label__4
(i64.store (i32.wrap_i64 (local.get $pos)) (call $endian_swap (local.get $y1)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 8))))) (call $endian_swap (local.get $y2)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 16))))) (call $endian_swap (local.get $y3)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 24))))) (call $endian_swap (local.get $y4)))
)
)
)
+197 -161
View File
@@ -154,7 +154,7 @@ object "object" {
Binary representation:
0061736d0100000001480a60000060017e017e60027e7e017e60037e7e7e017e60047e7e7e7e017e60057e7e7e7e7e0060087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60027f7f0060037f7f7f0002310208657468657265756d0c73746f7261676553746f7265000808657468657265756d0c63616c6c44617461436f70790009030e0d0003070407020704010101050605030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00020a82090df002011f7e4200210002402000200020002000100921012300210223012103230221040b2001210520022106200321072004210842012109200020008420002009848450ada745ada745ad210a02400340200aa745ad500d01024002402005200620072008200020002000420a1008210b2300210c2301210d2302210e0b0240200b200c200d200e1005210f2300211023012111230221120b200f20108420112012848450ada745ad42005204400c030b024020052006200720082000200020004202100621132300211423012115230221160b201320148420152016848450ada745ad42005204400c030b0240200520062007200820002000200042041006211723002118230121192302211a0b20172018842019201a848450ada745ad42005204400c010b0b0240200520062007200820002000200020091004211b2300211c2301211d2302211e0b201b2105201c2106201d2107201e21080c000b0b20002000200020002005200620072008100e0b2c01037e200020017c2105200520027c21032005200054ada72003200554ada772ada7ad21042004240020030b6f010b7e200320077c210c200c42007c210b024020022006200c200354ada7200b200c54ada772ada7ad1003210d2300210e0b200d210a024020012005200e1003210f230021100b200f2109024020002004201010032111230021120b2011210820092400200a2401200b240220080b2301047e200020018420022003848450ada7ad210720052400200624012007240220040b4601047e2000200451ad42005204402001200551ad42005204402002200651ad42005204402003200751ad42005204404201210b0b0b0b0b20092400200a2401200b240220080b2a01027e02402000200154ad21032003420151044042ffffffff0f2102052000200152ad21020b0b20020b930101087e4200210c0240200020041007210d200d42005104400240200120051007210e200e42005104400240200220061007210f200f42005104402003200754ad210c05200f42015104404200210c054201210c0b0b0b05200e42015104404200210c054201210c0b0b0b05200d42015104404200210c054201210c0b0b0b200ca7ad210b20092400200a2401200b240220080b8c0101087e4200200020018420028452ad4200520440000b4200200342208852ad4200520440000b4200a72003a7ada74220a710014200a7290300100c21084200a74208a76aada7290300100c21094200a74210a76aada7290300100c210a4200a74218a76aada7290300100c210b2008210420092105200a2106200b210720052400200624012007240220040b1c01017e20004208864280fe0383200042088842ff018384210120010b1b01027e2000100a421086210220022000421088100a84210120010b1b01027e2000100b422086210220022000422088100b84210120010b3e01007e2000a72001100c3703002000a74208a76aada72002100c3703002000a74210a76aada72003100c3703002000a74218a76aada72004100c3703000b2401007e42002000200120022003100d42202004200520062007100d4200a74220a710000b
0061736d0100000001480a60000060017e017e60027e7e017e60037e7e7e017e60047e7e7e7e017e60057e7e7e7e7e0060087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60027f7f0060037f7f7f0002310208657468657265756d0c73746f7261676553746f7265000808657468657265756d0c63616c6c44617461436f70790009030e0d0003070407020704010101050605030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00020aa9090df302011f7e02404200210002402000200020002000100921012300210223012103230221040b2001210520022106200321072004210842012109200020008420002009848450ada745ada745ad210a02400340200aa745ad500d01024002402005200620072008200020002000420a1008210b2300210c2301210d2302210e0b0240200b200c200d200e1005210f2300211023012111230221120b200f20108420112012848450ada745ad42005204400c030b024020052006200720082000200020004202100621132300211423012115230221160b201320148420152016848450ada745ad42005204400c030b0240200520062007200820002000200042041006211723002118230121192302211a0b20172018842019201a848450ada745ad42005204400c010b0b0240200520062007200820002000200020091004211b2300211c2301211d2302211e0b201b2105201c2106201d2107201e21080c000b0b20002000200020002005200620072008100e0b0b2f01037e0240200020017c2105200520027c21032005200054ada72003200554ada772ada7ad21040b2004240020030b72010b7e0240200320077c210c200c42007c210b024020022006200c200354ada7200b200c54ada772ada7ad1003210d2300210e0b200d210a024020012005200e1003210f230021100b200f2109024020002004201010032111230021120b201121080b20092400200a2401200b240220080b2601047e0240200020018420022003848450ada7ad21070b20052400200624012007240220040b4901047e02402000200451ad42005204402001200551ad42005204402002200651ad42005204402003200751ad42005204404201210b0b0b0b0b0b20092400200a2401200b240220080b2d01027e024002402000200154ad21032003420151044042ffffffff0f2102052000200152ad21020b0b0b20020b960101087e02404200210c0240200020041007210d200d42005104400240200120051007210e200e42005104400240200220061007210f200f42005104402003200754ad210c05200f42015104404200210c054201210c0b0b0b05200e42015104404200210c054201210c0b0b0b05200d42015104404200210c054201210c0b0b0b200ca7ad210b0b20092400200a2401200b240220080b8f0101087e02404200200020018420028452ad4200520440000b4200200342208852ad4200520440000b4200a72003a7ada74220a710014200a7290300100c21084200a74208a76aada7290300100c21094200a74210a76aada7290300100c210a4200a74218a76aada7290300100c210b2008210420092105200a2106200b21070b20052400200624012007240220040b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100a421086210220022000421088100a8421010b20010b1e01027e02402000100b422086210220022000422088100b8421010b20010b4101007e02402000a72001100c3703002000a74208a76aada72002100c3703002000a74210a76aada72003100c3703002000a74218a76aada72004100c3703000b0b2701007e024042002000200120022003100d42202004200520062007100d4200a74220a710000b0b
Text representation:
(module
@@ -198,79 +198,81 @@ Text representation:
(local $x_9 i64)
(local $x_10 i64)
(local $x_11 i64)
(local.set $_1 (i64.const 0))
(block
(local.set $x (call $calldataload (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1)))
(local.set $x_1 (global.get $global_))
(local.set $x_2 (global.get $global__1))
(local.set $x_3 (global.get $global__2))
)
(local.set $x_4 (local.get $x))
(local.set $x_5 (local.get $x_1))
(local.set $x_6 (local.get $x_2))
(local.set $x_7 (local.get $x_3))
(local.set $_2 (i64.const 1))
(local.set $_3 (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_1) (local.get $_1)) (i64.or (local.get $_1) (local.get $_2))))))))))))
(block $label_
(loop $label__4
(br_if $label_ (i64.eqz (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (local.get $_3))))))
(block $label__3
(block
(local.set $_4 (call $lt (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10)))
(local.set $_5 (global.get $global_))
(local.set $_6 (global.get $global__1))
(local.set $_7 (global.get $global__2))
(local.set $_1 (i64.const 0))
(block
(local.set $x (call $calldataload (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1)))
(local.set $x_1 (global.get $global_))
(local.set $x_2 (global.get $global__1))
(local.set $x_3 (global.get $global__2))
)
(block
(local.set $_8 (call $iszero (local.get $_4) (local.get $_5) (local.get $_6) (local.get $_7)))
(local.set $_9 (global.get $global_))
(local.set $_10 (global.get $global__1))
(local.set $_11 (global.get $global__2))
)
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_8) (local.get $_9)) (i64.or (local.get $_10) (local.get $_11)))))))) (i64.const 0)) (then
(br $label_)
))
(block
(local.set $_12 (call $eq (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 2)))
(local.set $_13 (global.get $global_))
(local.set $_14 (global.get $global__1))
(local.set $_15 (global.get $global__2))
)
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_12) (local.get $_13)) (i64.or (local.get $_14) (local.get $_15)))))))) (i64.const 0)) (then
(br $label_)
))
(block
(local.set $_16 (call $eq (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 4)))
(local.set $_17 (global.get $global_))
(local.set $_18 (global.get $global__1))
(local.set $_19 (global.get $global__2))
)
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_16) (local.get $_17)) (i64.or (local.get $_18) (local.get $_19)))))))) (i64.const 0)) (then
(br $label__3)
))
)
(block
(local.set $x_8 (call $add (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_2)))
(local.set $x_9 (global.get $global_))
(local.set $x_10 (global.get $global__1))
(local.set $x_11 (global.get $global__2))
)
(local.set $x_4 (local.get $x_8))
(local.set $x_5 (local.get $x_9))
(local.set $x_6 (local.get $x_10))
(local.set $x_7 (local.get $x_11))
(br $label__4)
)
(local.set $x_4 (local.get $x))
(local.set $x_5 (local.get $x_1))
(local.set $x_6 (local.get $x_2))
(local.set $x_7 (local.get $x_3))
(local.set $_2 (i64.const 1))
(local.set $_3 (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_1) (local.get $_1)) (i64.or (local.get $_1) (local.get $_2))))))))))))
(block $label__3
(loop $label__5
(br_if $label__3 (i64.eqz (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (local.get $_3))))))
(block $label__4
(block
(local.set $_4 (call $lt (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10)))
(local.set $_5 (global.get $global_))
(local.set $_6 (global.get $global__1))
(local.set $_7 (global.get $global__2))
)
(block
(local.set $_8 (call $iszero (local.get $_4) (local.get $_5) (local.get $_6) (local.get $_7)))
(local.set $_9 (global.get $global_))
(local.set $_10 (global.get $global__1))
(local.set $_11 (global.get $global__2))
)
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_8) (local.get $_9)) (i64.or (local.get $_10) (local.get $_11)))))))) (i64.const 0)) (then
(br $label__3)
))
(block
(local.set $_12 (call $eq (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 2)))
(local.set $_13 (global.get $global_))
(local.set $_14 (global.get $global__1))
(local.set $_15 (global.get $global__2))
)
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_12) (local.get $_13)) (i64.or (local.get $_14) (local.get $_15)))))))) (i64.const 0)) (then
(br $label__3)
))
(block
(local.set $_16 (call $eq (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 4)))
(local.set $_17 (global.get $global_))
(local.set $_18 (global.get $global__1))
(local.set $_19 (global.get $global__2))
)
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $_16) (local.get $_17)) (i64.or (local.get $_18) (local.get $_19)))))))) (i64.const 0)) (then
(br $label__4)
))
)
(block
(local.set $x_8 (call $add (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_2)))
(local.set $x_9 (global.get $global_))
(local.set $x_10 (global.get $global__1))
(local.set $x_11 (global.get $global__2))
)
(local.set $x_4 (local.get $x_8))
(local.set $x_5 (local.get $x_9))
(local.set $x_6 (local.get $x_10))
(local.set $x_7 (local.get $x_11))
(br $label__5)
)
)
(call $sstore (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7))
)
(call $sstore (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7))
)
(func $add_carry
@@ -281,9 +283,12 @@ Text representation:
(local $r i64)
(local $r_c i64)
(local $t i64)
(local.set $t (i64.add (local.get $x) (local.get $y)))
(local.set $r (i64.add (local.get $t) (local.get $c)))
(local.set $r_c (i64.extend_i32_u (i32.wrap_i64 (i64.extend_i32_u (i32.or (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $t) (local.get $x)))) (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $r) (local.get $t)))))))))
(block $label__6
(local.set $t (i64.add (local.get $x) (local.get $y)))
(local.set $r (i64.add (local.get $t) (local.get $c)))
(local.set $r_c (i64.extend_i32_u (i32.wrap_i64 (i64.extend_i32_u (i32.or (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $t) (local.get $x)))) (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $r) (local.get $t)))))))))
)
(global.set $global_ (local.get $r_c))
(local.get $r)
)
@@ -309,26 +314,29 @@ Text representation:
(local $carry_1 i64)
(local $r1_1 i64)
(local $carry_2 i64)
(local.set $t (i64.add (local.get $x4) (local.get $y4)))
(local.set $r4 (i64.add (local.get $t) (i64.const 0)))
(block
(local.set $r3_1 (call $add_carry (local.get $x3) (local.get $y3) (i64.extend_i32_u (i32.wrap_i64 (i64.extend_i32_u (i32.or (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $t) (local.get $x4)))) (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $r4) (local.get $t))))))))))
(local.set $carry (global.get $global_))
(block $label__7
(local.set $t (i64.add (local.get $x4) (local.get $y4)))
(local.set $r4 (i64.add (local.get $t) (i64.const 0)))
(block
(local.set $r3_1 (call $add_carry (local.get $x3) (local.get $y3) (i64.extend_i32_u (i32.wrap_i64 (i64.extend_i32_u (i32.or (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $t) (local.get $x4)))) (i32.wrap_i64 (i64.extend_i32_u (i64.lt_u (local.get $r4) (local.get $t))))))))))
(local.set $carry (global.get $global_))
)
(local.set $r3 (local.get $r3_1))
(block
(local.set $r2_1 (call $add_carry (local.get $x2) (local.get $y2) (local.get $carry)))
(local.set $carry_1 (global.get $global_))
)
(local.set $r2 (local.get $r2_1))
(block
(local.set $r1_1 (call $add_carry (local.get $x1) (local.get $y1) (local.get $carry_1)))
(local.set $carry_2 (global.get $global_))
)
(local.set $r1 (local.get $r1_1))
)
(local.set $r3 (local.get $r3_1))
(block
(local.set $r2_1 (call $add_carry (local.get $x2) (local.get $y2) (local.get $carry)))
(local.set $carry_1 (global.get $global_))
)
(local.set $r2 (local.get $r2_1))
(block
(local.set $r1_1 (call $add_carry (local.get $x1) (local.get $y1) (local.get $carry_1)))
(local.set $carry_2 (global.get $global_))
)
(local.set $r1 (local.get $r1_1))
(global.set $global_ (local.get $r2))
(global.set $global__1 (local.get $r3))
(global.set $global__2 (local.get $r4))
@@ -345,7 +353,10 @@ Text representation:
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(local.set $r4 (i64.extend_i32_u (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $x1) (local.get $x2)) (i64.or (local.get $x3) (local.get $x4))))))))
(block $label__8
(local.set $r4 (i64.extend_i32_u (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $x1) (local.get $x2)) (i64.or (local.get $x3) (local.get $x4))))))))
)
(global.set $global_ (local.get $r2))
(global.set $global__1 (local.get $r3))
(global.set $global__2 (local.get $r4))
@@ -366,15 +377,18 @@ Text representation:
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x1) (local.get $y1))) (i64.const 0)) (then
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x2) (local.get $y2))) (i64.const 0)) (then
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x3) (local.get $y3))) (i64.const 0)) (then
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x4) (local.get $y4))) (i64.const 0)) (then
(local.set $r4 (i64.const 1))
(block $label__9
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x1) (local.get $y1))) (i64.const 0)) (then
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x2) (local.get $y2))) (i64.const 0)) (then
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x3) (local.get $y3))) (i64.const 0)) (then
(if (i64.ne (i64.extend_i32_u (i64.eq (local.get $x4) (local.get $y4))) (i64.const 0)) (then
(local.set $r4 (i64.const 1))
))
))
))
))
))
)
(global.set $global_ (local.get $r2))
(global.set $global__1 (local.get $r3))
(global.set $global__2 (local.get $r4))
@@ -387,13 +401,16 @@ Text representation:
(result i64)
(local $r i64)
(local $condition i64)
(block
(local.set $condition (i64.extend_i32_u (i64.lt_u (local.get $a) (local.get $b))))
(if (i64.eq (local.get $condition) (i64.const 1)) (then
(local.set $r (i64.const 4294967295))
)(else
(local.set $r (i64.extend_i32_u (i64.ne (local.get $a) (local.get $b))))
))
(block $label__10
(block
(local.set $condition (i64.extend_i32_u (i64.lt_u (local.get $a) (local.get $b))))
(if (i64.eq (local.get $condition) (i64.const 1)) (then
(local.set $r (i64.const 4294967295))
)(else
(local.set $r (i64.extend_i32_u (i64.ne (local.get $a) (local.get $b))))
))
)
)
(local.get $r)
@@ -414,48 +431,51 @@ Text representation:
(local $z3 i64)
(local $z4 i64)
(local $z i64)
(local $condition_5 i64)
(local $condition_6 i64)
(local $condition_7 i64)
(local.set $z (i64.const 0))
(block
(local.set $condition_5 (call $cmp (local.get $x1) (local.get $y1)))
(if (i64.eq (local.get $condition_5) (i64.const 0)) (then
(block
(local.set $condition_6 (call $cmp (local.get $x2) (local.get $y2)))
(if (i64.eq (local.get $condition_6) (i64.const 0)) (then
(block
(local.set $condition_7 (call $cmp (local.get $x3) (local.get $y3)))
(if (i64.eq (local.get $condition_7) (i64.const 0)) (then
(local.set $z (i64.extend_i32_u (i64.lt_u (local.get $x4) (local.get $y4))))
)(else
(if (i64.eq (local.get $condition_7) (i64.const 1)) (then
(local.set $z (i64.const 0))
(local $condition_12 i64)
(local $condition_13 i64)
(local $condition_14 i64)
(block $label__11
(local.set $z (i64.const 0))
(block
(local.set $condition_12 (call $cmp (local.get $x1) (local.get $y1)))
(if (i64.eq (local.get $condition_12) (i64.const 0)) (then
(block
(local.set $condition_13 (call $cmp (local.get $x2) (local.get $y2)))
(if (i64.eq (local.get $condition_13) (i64.const 0)) (then
(block
(local.set $condition_14 (call $cmp (local.get $x3) (local.get $y3)))
(if (i64.eq (local.get $condition_14) (i64.const 0)) (then
(local.set $z (i64.extend_i32_u (i64.lt_u (local.get $x4) (local.get $y4))))
)(else
(local.set $z (i64.const 1))
(if (i64.eq (local.get $condition_14) (i64.const 1)) (then
(local.set $z (i64.const 0))
)(else
(local.set $z (i64.const 1))
))
))
))
)
)(else
(if (i64.eq (local.get $condition_6) (i64.const 1)) (then
(local.set $z (i64.const 0))
)
)(else
(local.set $z (i64.const 1))
(if (i64.eq (local.get $condition_13) (i64.const 1)) (then
(local.set $z (i64.const 0))
)(else
(local.set $z (i64.const 1))
))
))
))
)
)(else
(if (i64.eq (local.get $condition_5) (i64.const 1)) (then
(local.set $z (i64.const 0))
)
)(else
(local.set $z (i64.const 1))
(if (i64.eq (local.get $condition_12) (i64.const 1)) (then
(local.set $z (i64.const 0))
)(else
(local.set $z (i64.const 1))
))
))
))
)
(local.set $z4 (i64.extend_i32_u (i32.wrap_i64 (local.get $z))))
)
(local.set $z4 (i64.extend_i32_u (i32.wrap_i64 (local.get $z))))
(global.set $global_ (local.get $z2))
(global.set $global__1 (local.get $z3))
(global.set $global__2 (local.get $z4))
@@ -476,19 +496,22 @@ Text representation:
(local $z2_1 i64)
(local $z3_1 i64)
(local $z4_1 i64)
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3)))) (i64.const 0)) (then
(unreachable)))
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32)))) (i64.const 0)) (then
(unreachable)))
(call $eth.callDataCopy (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.extend_i32_u (i32.wrap_i64 (local.get $x4)))) (i32.wrap_i64 (i64.const 32)))
(local.set $z1_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.const 0)))))
(local.set $z2_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 8))))))))
(local.set $z3_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 16))))))))
(local.set $z4_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 24))))))))
(local.set $z1 (local.get $z1_1))
(local.set $z2 (local.get $z2_1))
(local.set $z3 (local.get $z3_1))
(local.set $z4 (local.get $z4_1))
(block $label__15
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3)))) (i64.const 0)) (then
(unreachable)))
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32)))) (i64.const 0)) (then
(unreachable)))
(call $eth.callDataCopy (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.extend_i32_u (i32.wrap_i64 (local.get $x4)))) (i32.wrap_i64 (i64.const 32)))
(local.set $z1_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.const 0)))))
(local.set $z2_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 8))))))))
(local.set $z3_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 16))))))))
(local.set $z4_1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 24))))))))
(local.set $z1 (local.get $z1_1))
(local.set $z2 (local.get $z2_1))
(local.set $z3 (local.get $z3_1))
(local.set $z4 (local.get $z4_1))
)
(global.set $global_ (local.get $z2))
(global.set $global__1 (local.get $z3))
(global.set $global__2 (local.get $z4))
@@ -499,7 +522,10 @@ Text representation:
(param $x i64)
(result i64)
(local $y i64)
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
(block $label__16
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
)
(local.get $y)
)
@@ -508,8 +534,11 @@ Text representation:
(result i64)
(local $y i64)
(local $hi i64)
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
(block $label__17
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
)
(local.get $y)
)
@@ -518,8 +547,11 @@ Text representation:
(result i64)
(local $y i64)
(local $hi i64)
(local.set $hi (i64.shl (call $endian_swap_32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $x) (i64.const 32)))))
(block $label__18
(local.set $hi (i64.shl (call $endian_swap_32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $x) (i64.const 32)))))
)
(local.get $y)
)
@@ -529,10 +561,12 @@ Text representation:
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(i64.store (i32.wrap_i64 (local.get $pos)) (call $endian_swap (local.get $y1)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 8))))) (call $endian_swap (local.get $y2)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 16))))) (call $endian_swap (local.get $y3)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 24))))) (call $endian_swap (local.get $y4)))
(block $label__19
(i64.store (i32.wrap_i64 (local.get $pos)) (call $endian_swap (local.get $y1)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 8))))) (call $endian_swap (local.get $y2)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 16))))) (call $endian_swap (local.get $y3)))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $pos)) (i32.wrap_i64 (i64.const 24))))) (call $endian_swap (local.get $y4)))
)
)
(func $sstore
@@ -544,9 +578,11 @@ Text representation:
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(call $mstore_internal (i64.const 0) (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))
(call $mstore_internal (i64.const 32) (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))
(call $eth.storageStore (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 32)))
(block $label__20
(call $mstore_internal (i64.const 0) (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))
(call $mstore_internal (i64.const 32) (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))
(call $eth.storageStore (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 32)))
)
)
)
@@ -16,25 +16,27 @@
(local $z2 i64)
(local $z3 i64)
(local $_3 i64)
(local.set $_1 (i64.const 0))
(local.set $p (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 64)))
(local.set $r (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $p)) (i32.wrap_i64 (i64.const 64)))))
(if (i64.ne (i64.extend_i32_u (i32.lt_u (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (local.get $p)))) (i64.const 0)) (then
(unreachable)))
(local.set $_2 (call $endian_swap (local.get $_1)))
(i64.store (i32.wrap_i64 (local.get $r)) (local.get $_2))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (i64.const 8))))) (local.get $_2))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (i64.const 16))))) (local.get $_2))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (i64.const 24))))) (call $endian_swap (i64.const 128)))
(call $eth.getCallValue (i32.wrap_i64 (i64.const 0)))
(local.set $z1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.const 0)))))
(local.set $z2 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 8))))))))
(local.set $z3 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 16))))))))
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $z1) (local.get $z2)) (i64.or (local.get $z3) (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 24)))))))))))))) (i64.const 0)) (then
(call $revert (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))))
(local.set $_3 (datasize \"C_2_deployed\"))
(call $codecopy (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (dataoffset \"C_2_deployed\") (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_3))
(call $return (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_3))
(block $label_
(local.set $_1 (i64.const 0))
(local.set $p (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 64)))
(local.set $r (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $p)) (i32.wrap_i64 (i64.const 64)))))
(if (i64.ne (i64.extend_i32_u (i32.lt_u (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (local.get $p)))) (i64.const 0)) (then
(unreachable)))
(local.set $_2 (call $endian_swap (local.get $_1)))
(i64.store (i32.wrap_i64 (local.get $r)) (local.get $_2))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (i64.const 8))))) (local.get $_2))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (i64.const 16))))) (local.get $_2))
(i64.store (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (i64.const 24))))) (call $endian_swap (i64.const 128)))
(call $eth.getCallValue (i32.wrap_i64 (i64.const 0)))
(local.set $z1 (call $endian_swap (i64.load (i32.wrap_i64 (i64.const 0)))))
(local.set $z2 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 8))))))))
(local.set $z3 (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 16))))))))
(if (i64.ne (i64.extend_i32_u (i32.eqz (i32.wrap_i64 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $z1) (local.get $z2)) (i64.or (local.get $z3) (call $endian_swap (i64.load (i32.wrap_i64 (i64.extend_i32_u (i32.add (i32.wrap_i64 (i64.const 0)) (i32.wrap_i64 (i64.const 24)))))))))))))) (i64.const 0)) (then
(call $revert (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))))
(local.set $_3 (datasize \"C_2_deployed\"))
(call $codecopy (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (dataoffset \"C_2_deployed\") (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_3))
(call $return (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_3))
)
)
(func $u256_to_i32
@@ -44,11 +46,14 @@
(param $x4 i64)
(result i64)
(local $v i64)
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3)))) (i64.const 0)) (then
(unreachable)))
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32)))) (i64.const 0)) (then
(unreachable)))
(local.set $v (i64.extend_i32_u (i32.wrap_i64 (local.get $x4))))
(block $label__1
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3)))) (i64.const 0)) (then
(unreachable)))
(if (i64.ne (i64.extend_i32_u (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32)))) (i64.const 0)) (then
(unreachable)))
(local.set $v (i64.extend_i32_u (i32.wrap_i64 (local.get $x4))))
)
(local.get $v)
)
@@ -60,10 +65,13 @@
(result i64)
(local $r i64)
(local $p i64)
(local.set $p (call $u256_to_i32 (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)))
(local.set $r (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $p)) (i32.wrap_i64 (i64.const 64)))))
(if (i64.ne (i64.extend_i32_u (i32.lt_u (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (local.get $p)))) (i64.const 0)) (then
(unreachable)))
(block $label__2
(local.set $p (call $u256_to_i32 (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)))
(local.set $r (i64.extend_i32_u (i32.add (i32.wrap_i64 (local.get $p)) (i32.wrap_i64 (i64.const 64)))))
(if (i64.ne (i64.extend_i32_u (i32.lt_u (i32.wrap_i64 (local.get $r)) (i32.wrap_i64 (local.get $p)))) (i64.const 0)) (then
(unreachable)))
)
(local.get $r)
)
@@ -80,14 +88,19 @@
(param $z2 i64)
(param $z3 i64)
(param $z4 i64)
(call $eth.codeCopy (i32.wrap_i64 (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $z1) (local.get $z2) (local.get $z3) (local.get $z4))))
(block $label__3
(call $eth.codeCopy (i32.wrap_i64 (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $z1) (local.get $z2) (local.get $z3) (local.get $z4))))
)
)
(func $endian_swap_16
(param $x i64)
(result i64)
(local $y i64)
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
(block $label__4
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
)
(local.get $y)
)
@@ -96,8 +109,11 @@
(result i64)
(local $y i64)
(local $hi i64)
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
(block $label__5
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
)
(local.get $y)
)
@@ -106,8 +122,11 @@
(result i64)
(local $y i64)
(local $hi i64)
(local.set $hi (i64.shl (call $endian_swap_32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $x) (i64.const 32)))))
(block $label__6
(local.set $hi (i64.shl (call $endian_swap_32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $x) (i64.const 32)))))
)
(local.get $y)
)
@@ -120,7 +139,9 @@
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(call $eth.finish (i32.wrap_i64 (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))))
(block $label__7
(call $eth.finish (i32.wrap_i64 (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))))
)
)
(func $revert
@@ -132,7 +153,9 @@
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(call $eth.revert (i32.wrap_i64 (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))))
(block $label__8
(call $eth.revert (i32.wrap_i64 (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) (i32.wrap_i64 (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))))
)
)
)
@@ -4,5 +4,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0xc0, 0x20, 0x4, 0x3, 0x4, 0x5, 0x6 -> 0x20, 0x4, 0x3, 0x4, 0x5, 0x6
@@ -8,5 +8,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0xc0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 -> 1, 2, 3, 4, 5, 6
@@ -11,5 +11,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0xc0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 -> 1, 2, 3, 4, 5, 6
@@ -4,5 +4,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x20, 0x21 -> 33
@@ -5,5 +5,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f() -> 0x21, 0x40, 0x7, "abcdefg"
@@ -5,5 +5,8 @@ contract C {
f = abi.decode(msg.data[4 + 32 : 4 + 32 + 32], (uint256));
}
}
// ====
// compileViaYul: also
// ----
// f(uint256,uint256): 42, 23 -> 42, 23, 42, 23
@@ -18,6 +18,9 @@ contract C {
}
}
}
// ====
// compileViaYul: also
// ----
// test(bytes): 0x20, 0x80, 0x40, 0x60, 0, 0 -> false, false
// test(bytes): 0x20, 0xC0, 0x40, 0x80, 1, 0x42, 1, 0x42 -> false, false
@@ -7,5 +7,8 @@ contract C {
return abi.decode(data, (uint256, bytes));
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
@@ -3,5 +3,8 @@ contract C {
return abi.decode(data, (uint256, bytes));
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
@@ -6,5 +6,6 @@ contract C {
return abi.decode(data, (uint256, bytes));
}
}
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
@@ -0,0 +1,12 @@
contract C {
function f(bytes calldata b, uint i) internal pure returns (byte) {
return b[i];
}
function f(uint, bytes calldata b, uint) external pure returns (byte) {
return f(b, 2);
}
}
// ====
// compileViaYul: also
// ----
// f(uint256,bytes,uint256): 7, 0x60, 7, 4, "abcd" -> "c"
@@ -0,0 +1,17 @@
contract C {
function(bytes calldata) returns (byte) x;
constructor() public { x = f; }
function f(bytes calldata b) internal pure returns (byte) {
return b[2];
}
function h(bytes calldata b) external returns (byte) {
return x(b);
}
function g() external returns (byte) {
bytes memory a = new bytes(34);
a[2] = byte(uint8(7));
return this.h(a);
}
}
// ----
// g() -> 0x0700000000000000000000000000000000000000000000000000000000000000
@@ -0,0 +1,22 @@
library L {
function f(uint, bytes calldata _x, uint) internal returns (byte) {
return _x[2];
}
}
contract C {
function f(bytes calldata a)
external
returns (byte)
{
return L.f(3, a, 9);
}
function g() public returns (byte) {
bytes memory x = new bytes(4);
x[2] = 0x08;
return this.f(x);
}
}
// ====
// compileViaYul: also
// ----
// g() -> 0x0800000000000000000000000000000000000000000000000000000000000000
@@ -0,0 +1,23 @@
pragma experimental ABIEncoderV2;
contract C {
function g(uint[][2] calldata s) internal pure returns (uint, uint[] calldata) {
return (s[0][1], s[1]);
}
function f(uint, uint[][2] calldata s, uint) external pure returns (uint, uint) {
(uint x, uint[] calldata y) = g(s);
return (x, y[0]);
}
function g() public returns (uint, uint) {
uint[][2] memory x;
x[0] = new uint[](2);
x[1] = new uint[](2);
x[0][1] = 7;
x[1][0] = 8;
return this.f(4, x, 5);
}
}
// ====
// compileViaYul: also
// ----
// g() -> 7, 8
@@ -0,0 +1,19 @@
contract C {
function g(uint[3][2] calldata s) internal pure returns (uint, uint[3] calldata) {
return (s[0][1], s[1]);
}
function f(uint, uint[3][2] calldata s, uint) external pure returns (uint, uint) {
(uint x, uint[3] calldata y) = g(s);
return (x, y[0]);
}
function g() public returns (uint, uint) {
uint[3][2] memory x;
x[0][1] = 7;
x[1][0] = 8;
return this.f(4, x, 5);
}
}
// ====
// compileViaYul: also
// ----
// g() -> 7, 8
@@ -0,0 +1,21 @@
contract C {
function f(bytes memory _a, bytes calldata _b, bytes memory _c)
public
returns (uint, byte, byte, byte)
{
return (_a.length + _b.length + _c.length, _a[1], _b[1], _c[1]);
}
function g() public returns (uint, byte, byte, byte) {
bytes memory x = new bytes(3);
bytes memory y = new bytes(4);
bytes memory z = new bytes(7);
x[1] = 0x08;
y[1] = 0x09;
z[1] = 0x0a;
return this.f(x, y, z);
}
}
// ====
// compileViaYul: also
// ----
// g() -> 0x0e, 0x0800000000000000000000000000000000000000000000000000000000000000, 0x0900000000000000000000000000000000000000000000000000000000000000, 0x0a00000000000000000000000000000000000000000000000000000000000000
@@ -0,0 +1,17 @@
pragma experimental ABIEncoderV2;
struct S {
uint x;
uint y;
}
contract C {
function f(S calldata s) internal pure returns (uint, uint) {
return (s.x, s.y);
}
function f(uint, S calldata s, uint) external pure returns (uint, uint) {
return f(s);
}
}
// ----
// f(uint256,(uint256,uint256),uint256): 7, 1, 2, 4 -> 1, 2
@@ -0,0 +1,31 @@
contract Test {
bytes6 name;
constructor() public {
function (bytes6 _name) internal setter = setName;
setter("abcdef");
applyShift(leftByteShift, 3);
}
function getName() public returns (bytes6 ret) {
return name;
}
function setName(bytes6 _name) private {
name = _name;
}
function leftByteShift(bytes6 _value, uint _shift) public returns (bytes6) {
return _value << _shift * 8;
}
function applyShift(function (bytes6 _value, uint _shift) internal returns (bytes6) _shiftOperator, uint _bytes) internal {
name = _shiftOperator(name, _bytes);
}
}
// ====
// compileViaYul: also
// ----
// getName() -> "def\x00\x00\x00"
@@ -0,0 +1,24 @@
contract C {
function foo() internal returns (uint) {
return 42;
}
function get_ptr(function() internal returns (uint) ptr) internal returns(function() internal returns (uint)) {
return ptr;
}
function associated() public returns (uint) {
// This expression directly references function definition
return (foo)();
}
function unassociated() public returns (uint) {
// This expression is not associated with a specific function definition
return (get_ptr(foo))();
}
}
// ====
// compileViaYul: also
// ----
// associated() -> 42
// unassociated() -> 42
@@ -22,5 +22,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(uint256[]): 0x20, 0x3, 0x1, 0x7, 0x3 -> 11
@@ -0,0 +1,21 @@
contract A {
function f() internal virtual returns (uint256) {
return 1;
}
}
contract B is A {
function f() internal override returns (uint256) {
return 2;
}
function g() public returns (uint256) {
function() internal returns (uint256) ptr = A.f;
return ptr();
}
}
// ====
// compileViaYul: also
// ----
// g() -> 1
@@ -0,0 +1,17 @@
library L {
function f() internal returns (uint) {
return 66;
}
}
contract C {
function g() public returns (uint) {
function() internal returns(uint) ptr;
ptr = L.f;
return ptr();
}
}
// ====
// compileViaYul: also
// ----
// g() -> 66
@@ -0,0 +1,26 @@
contract Base {
function f() internal returns (uint256 i) {
function() internal returns (uint256) ptr = g;
return ptr();
}
function g() internal virtual returns (uint256 i) {
return 1;
}
}
contract Derived is Base {
function g() internal override returns (uint256 i) {
return 2;
}
function h() public returns (uint256 i) {
return f();
}
}
// ====
// compileViaYul: also
// ----
// h() -> 2
@@ -0,0 +1,8 @@
// Used to cause ICE
contract C {
function f() public {
abi.decode("", (byte[999999999]));
}
}
// ----
// TypeError: (75-90): Type too large for memory.
@@ -6,4 +6,4 @@ contract C {
// ----
// DeclarationError: (28-45): The "constant" keyword can only be used for state variables.
// TypeError: (69-72): Invalid array length, expected integer literal or constant expression.
// TypeError: (64-75): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (64-75): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -0,0 +1,8 @@
// Used to cause ICE
contract C {
function f(uint[] calldata x) external pure {
x[1:2].a;
}
}
// ----
// TypeError: (92-100): Member "a" not found or not visible after argument-dependent lookup in uint256[] calldata slice.
@@ -0,0 +1,10 @@
contract C {
function f(uint[] calldata _c) public pure {
uint[] calldata c;
if (_c[2] > 10)
c = _c;
c[2];
}
}
// ----
// TypeError: (141-142): This variable is of calldata pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
@@ -0,0 +1,11 @@
contract C {
function f(uint[] calldata _c) public pure {
uint[] calldata c;
if (_c[2] > 10)
c = _c;
else
c = _c;
c[2];
}
}
// ----
@@ -0,0 +1,16 @@
contract C {
function g() internal pure returns (bytes calldata) {
return msg.data;
}
function h(uint[] calldata _c) internal pure {
uint[] calldata c;
c = _c;
c[2];
}
function i(uint[] calldata _c) internal pure {
uint[] calldata c;
(c) = _c;
c[2];
}
}
// ----
@@ -5,5 +5,4 @@ library L {
}
// ----
// TypeError: (66-81): Data location must be "memory" for parameter in function, but "calldata" was given.
// TypeError: (159-173): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (159-173): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given.
@@ -2,4 +2,4 @@ contract C {
function i() external pure returns(uint[]) {}
}
// ----
// TypeError: (52-58): Data location must be "memory" for return parameter in function, but none was given.
// TypeError: (52-58): Data location must be "memory" or "calldata" for return parameter in function, but none was given.
@@ -2,4 +2,5 @@ contract test {
function f(bytes memory) external;
}
// ----
// TypeError: (31-43): Data location must be "calldata" for parameter in external function, but "memory" was given.
// TypeError: (0-56): Contract "test" should be marked as abstract.
// TypeError: (20-54): Functions without implementation must be marked virtual.
@@ -2,4 +2,4 @@ contract test {
function f(bytes storage) external;
}
// ----
// TypeError: (31-44): Data location must be "calldata" for parameter in external function, but "storage" was given.
// TypeError: (31-44): Data location must be "memory" or "calldata" for parameter in external function, but "storage" was given.
@@ -2,4 +2,5 @@ contract test {
function f(bytes calldata) internal;
}
// ----
// TypeError: (31-45): Data location must be "storage" or "memory" for parameter in function, but "calldata" was given.
// TypeError: (0-58): Contract "test" should be marked as abstract.
// TypeError: (20-56): Functions without implementation must be marked virtual.
@@ -2,4 +2,4 @@ contract C {
function g(uint[]) internal pure {}
}
// ----
// TypeError: (28-34): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (28-34): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
@@ -2,4 +2,4 @@ contract C {
function g() internal pure returns(uint[]) {}
}
// ----
// TypeError: (52-58): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (52-58): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
@@ -6,7 +6,7 @@ library L {
function j(mapping(uint => uint)) external pure {}
}
// ----
// TypeError: (52-59): Data location must be "storage" or "calldata" for parameter in external function, but none was given.
// TypeError: (93-99): Data location must be "storage" or "calldata" for parameter in external function, but none was given.
// TypeError: (133-134): Data location must be "storage" or "calldata" for parameter in external function, but none was given.
// TypeError: (168-189): Data location must be "storage" or "calldata" for parameter in external function, but none was given.
// TypeError: (52-59): Data location must be "storage", "memory" or "calldata" for parameter in external function, but none was given.
// TypeError: (93-99): Data location must be "storage", "memory" or "calldata" for parameter in external function, but none was given.
// TypeError: (133-134): Data location must be "storage", "memory" or "calldata" for parameter in external function, but none was given.
// TypeError: (168-189): Data location must be "storage", "memory" or "calldata" for parameter in external function, but none was given.
@@ -6,7 +6,7 @@ library L {
function j() external pure returns (mapping(uint => uint)) {}
}
// ----
// TypeError: (77-84): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (129-135): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (180-181): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (226-247): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (77-84): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (129-135): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (180-181): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (226-247): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
@@ -10,11 +10,11 @@ library L {
function jp(mapping(uint => uint)) internal pure {}
}
// ----
// TypeError: (77-84): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (129-135): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (180-181): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (226-247): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (268-275): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (310-316): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (351-352): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (387-408): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (77-84): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (129-135): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (180-181): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (226-247): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (268-275): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (310-316): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (351-352): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (387-408): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
@@ -10,11 +10,11 @@ library L {
function jp(mapping(uint => uint)) private pure {}
}
// ----
// TypeError: (76-83): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (127-133): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (177-178): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (222-243): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (264-271): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (305-311): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (345-346): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (380-401): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (76-83): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (127-133): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (177-178): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (222-243): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (264-271): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (305-311): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (345-346): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (380-401): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
@@ -9,11 +9,11 @@ library L {
function ip(S) private pure {}
function jp(mapping(uint => uint)) private pure {}}
// ----
// TypeError: (76-83): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (127-133): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (177-178): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (222-243): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (264-271): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (305-311): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (345-346): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (380-401): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (76-83): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (127-133): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (177-178): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (222-243): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
// TypeError: (264-271): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (305-311): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (345-346): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
// TypeError: (380-401): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
@@ -2,4 +2,3 @@ library test {
function f(bytes memory) external {}
}
// ----
// TypeError: (30-42): Data location must be "storage" or "calldata" for parameter in external function, but "memory" was given.
@@ -2,4 +2,3 @@ library test {
function f(bytes calldata) internal pure {}
}
// ----
// TypeError: (30-44): Data location must be "storage" or "memory" for parameter in function, but "calldata" was given.
@@ -2,4 +2,4 @@ contract C {
function f(uint[]) private pure {}
}
// ----
// TypeError: (28-34): Data location must be "storage" or "memory" for parameter in function, but none was given.
// TypeError: (28-34): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given.
@@ -2,4 +2,4 @@ contract C {
function f() private pure returns(uint[]) {}
}
// ----
// TypeError: (51-57): Data location must be "storage" or "memory" for return parameter in function, but none was given.
// TypeError: (51-57): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given.
@@ -2,4 +2,5 @@ contract test {
function f(bytes calldata) public;
}
// ----
// TypeError: (31-45): Data location must be "memory" for parameter in function, but "calldata" was given.
// TypeError: (0-56): Contract "test" should be marked as abstract.
// TypeError: (20-54): Functions without implementation must be marked virtual.
@@ -2,4 +2,4 @@ contract test {
function f(bytes storage) public;
}
// ----
// TypeError: (31-44): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (31-44): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given.
@@ -2,4 +2,4 @@ contract C {
function h(uint[]) public pure {}
}
// ----
// TypeError: (28-34): Data location must be "memory" for parameter in function, but none was given.
// TypeError: (28-34): Data location must be "memory" or "calldata" for parameter in function, but none was given.
@@ -2,4 +2,4 @@ contract C {
function h() public pure returns(uint[]) {}
}
// ----
// TypeError: (50-56): Data location must be "memory" for return parameter in function, but none was given.
// TypeError: (50-56): Data location must be "memory" or "calldata" for return parameter in function, but none was given.
@@ -0,0 +1,9 @@
contract C {
function f() pure public {
assembly {
pop(pc())
}
}
}
// ----
// Warning: (61-63): The "pc" instruction is deprecated and will be removed in the next breaking release.
@@ -0,0 +1,7 @@
contract C {
function f() public {
[msg];
}
}
// ----
// TypeError: (47-52): Unable to deduce nameable type for array elements. Try adding explicit type conversion for the first element.
@@ -0,0 +1,7 @@
contract C {
function f() public {
[type(C)];
}
}
// ----
// TypeError: (47-56): Unable to deduce nameable type for array elements. Try adding explicit type conversion for the first element.
@@ -3,4 +3,4 @@ contract c {
}
// ----
// TypeError: (51-52): Invalid array length, expected integer literal or constant expression.
// TypeError: (45-55): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (45-55): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -3,4 +3,4 @@ contract c {
}
// ----
// TypeError: (51-53): Array with negative length specified.
// TypeError: (45-56): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (45-56): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -2,4 +2,3 @@ contract C {
function f(uint[] memory a) external {}
}
// ----
// TypeError: (28-43): Data location must be "calldata" for parameter in external function, but "memory" was given.
@@ -2,4 +2,4 @@ contract C {
function f(uint[] storage a) external {}
}
// ----
// TypeError: (28-44): Data location must be "calldata" for parameter in external function, but "storage" was given.
// TypeError: (28-44): Data location must be "memory" or "calldata" for parameter in external function, but "storage" was given.
@@ -5,4 +5,4 @@ contract test {
}
// ----
// TypeError: (55-58): Array with fractional length specified.
// TypeError: (50-61): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (50-61): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -5,4 +5,4 @@ contract test {
}
// ----
// TypeError: (55-65): Invalid array length, expected integer literal or constant expression.
// TypeError: (50-68): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (50-68): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -5,4 +5,4 @@ contract test {
}
// ----
// TypeError: (55-66): Invalid array length, expected integer literal or constant expression.
// TypeError: (50-69): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (50-69): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -9,5 +9,5 @@ contract C {
}
}
// ----
// TypeError: (104-107): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (123-131): Data location must be "storage" or "memory" for variable, but none was given.
// TypeError: (104-107): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
// TypeError: (123-131): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-57): Data location must be "calldata" for parameter in external function, but "storage" was given.
// TypeError: (28-57): Data location must be "memory" or "calldata" for parameter in external function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-57): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (28-57): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-59): Data location must be "calldata" for parameter in external function, but "storage" was given.
// TypeError: (28-59): Data location must be "memory" or "calldata" for parameter in external function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-59): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (28-59): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (37-64): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (37-64): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (57-84): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (57-84): Data location must be "memory" or "calldata" for return parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (53-84): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (53-84): Data location must be "memory" or "calldata" for return parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (51-82): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (51-82): Data location must be "memory" or "calldata" for return parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (53-82): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (53-82): Data location must be "memory" or "calldata" for return parameter in function, but "storage" was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (51-80): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (51-80): Data location must be "memory" or "calldata" for return parameter in function, but "storage" was given.
-8
View File
@@ -1,8 +0,0 @@
{
sstore(0, pc())
}
// ----
// Trace:
// INVALID()
// Memory dump:
// Storage dump:
@@ -6,7 +6,6 @@
pop(extcodehash(0))
pop(returndatasize())
pop(sload(0))
pop(pc())
pop(msize())
pop(mload(0))
pop(sload(0))
@@ -0,0 +1,9 @@
{
let ret := balance(address())
}
// ====
// EVMVersion: <istanbul
// ----
// step: expressionSimplifier
//
// { let ret := balance(address()) }
@@ -0,0 +1,13 @@
{
let a := address()
let ret := balance(a)
}
// ====
// EVMVersion: >=istanbul
// ----
// step: expressionSimplifier
//
// {
// let a := address()
// let ret := selfbalance()
// }
@@ -0,0 +1,9 @@
{
let ret := balance(address())
}
// ====
// EVMVersion: >=istanbul
// ----
// step: expressionSimplifier
//
// { let ret := selfbalance() }
@@ -1,10 +1,23 @@
{
let a
function gcd(_a, _b) -> out
{
// GCD algorithm. in order to test underlying stack compressor this function must not be inlined.
switch _b
case 0 { out := _a }
default { out := gcd(_b, mod(_a, _b)) }
}
function f() -> out
{
out := gcd(10, 15)
}
function foo_singlereturn_0() -> out
{
mstore(lt(or(gt(1,or(or(gt(or(or(or(1,gt(or(gt(or(or(keccak256(pc(),or(gt(not(pc()),1),1)),1),not(1)),pc()),1),pc())),lt(or(1,sub(pc(),1)),1)),pc()),1),1),gt(not(pc()),1))),1),1),1)
sstore(not(pc()),1)
mstore(lt(or(gt(1,or(or(gt(or(or(or(1,gt(or(gt(or(or(keccak256(f(),or(gt(not(f()),1),1)),1),not(1)),f()),1),f())),lt(or(1,sub(f(),1)),1)),f()),1),1),gt(not(f()),1))),1),1),1)
sstore(not(f()),1)
}
function foo_singlereturn_1(in_1, in_2) -> out
@@ -25,21 +38,27 @@
//
// {
// {
// let _1 := gt(not(pc()), 1)
// let _2 := pc()
// let _1 := gt(not(gcd(10, 15)), 1)
// let _2 := gcd(10, 15)
// let _3 := not(0)
// let _4 := lt(or(1, add(pc(), _3)), 1)
// let _5 := pc()
// let _6 := pc()
// pop(keccak256(pc(), or(gt(not(pc()), 1), 1)))
// let _4 := lt(or(1, add(gcd(10, 15), _3)), 1)
// let _5 := gcd(10, 15)
// let _6 := gcd(10, 15)
// pop(keccak256(gcd(10, 15), or(gt(not(gcd(10, 15)), 1), 1)))
// mstore(lt(or(gt(1, or(or(gt(or(or(or(gt(or(gt(_3, _6), 1), _5), _4), _2), 1), 1), _1), 1)), 1), 1), 1)
// sstore(not(pc()), 1)
// sstore(not(gcd(10, 15)), 1)
// sstore(0, 0)
// sstore(2, 1)
// pop(foo_singlereturn_1(calldataload(0), calldataload(3)))
// sstore(0, 0)
// sstore(3, 1)
// }
// function gcd(_a, _b) -> out
// {
// switch _b
// case 0 { out := _a }
// default { out := gcd(_b, mod(_a, _b)) }
// }
// function foo_singlereturn_1(in, in_1) -> out
// { extcodecopy(1, msize(), 1, 1) }
// }
@@ -1,11 +1,11 @@
{
{
let _13_71 := 1
let _17_72 := pc()
let _22_75 := pc()
let _25_76 := pc()
let _30_80 := pc()
let _32_81 := pc()
let _17_72 := msize()
let _22_75 := msize()
let _25_76 := msize()
let _30_80 := msize()
let _32_81 := msize()
// This should not be removed
pop(keccak256(1, 2))
let _104 := gt(not(_17_72), _13_71)
@@ -22,11 +22,11 @@
// step: stackCompressor
//
// {
// let _17_72 := pc()
// let _22_75 := pc()
// let _25_76 := pc()
// let _30_80 := pc()
// let _32_81 := pc()
// let _17_72 := msize()
// let _22_75 := msize()
// let _25_76 := msize()
// let _30_80 := msize()
// let _32_81 := msize()
// pop(keccak256(1, 2))
// let _105 := 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
// mstore(lt(or(gt(1, or(or(gt(or(or(or(gt(or(gt(_105, _32_81), 1), _30_80), lt(or(1, add(_25_76, _105)), 1)), _22_75), 1), 1), gt(not(_17_72), 1)), 1)), 1), 1), 1)
+7
View File
@@ -0,0 +1,7 @@
{
pop(pc())
}
// ====
// dialect: evmTyped
// ----
// Warning: (10-12): The "pc" instruction is deprecated and will be removed in the next breaking release.