-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
eof: Implement and use
ext*call
Showing
11 changed files
with
310 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
object "a" { | ||
code { | ||
if extcall(address(), 0, 0, 10) { | ||
return(0, 32) | ||
} | ||
|
||
if extdelegatecall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
if extstaticcall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
revert(0, 0) | ||
} | ||
} | ||
|
||
// ==== | ||
// EVMVersion: >=prague | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// Assembly: | ||
// /* "source":74:76 */ | ||
// 0x0a | ||
// /* "source":71:72 */ | ||
// 0x00 | ||
// /* "source":57:66 */ | ||
// dup1 | ||
// address | ||
// /* "source":49:77 */ | ||
// extcall | ||
// /* "source":46:95 */ | ||
// rjumpi{tag_1} | ||
// /* "source":22:266 */ | ||
// tag_2: | ||
// /* "source":141:142 */ | ||
// 0x00 | ||
// /* "source":127:136 */ | ||
// dup1 | ||
// address | ||
// /* "source":111:143 */ | ||
// extdelegatecall | ||
// /* "source":108:161 */ | ||
// rjumpi{tag_3} | ||
// /* "source":22:266 */ | ||
// tag_4: | ||
// /* "source":205:206 */ | ||
// 0x00 | ||
// /* "source":191:200 */ | ||
// dup1 | ||
// address | ||
// /* "source":177:207 */ | ||
// extstaticcall | ||
// /* "source":174:225 */ | ||
// rjumpi{tag_5} | ||
// /* "source":22:266 */ | ||
// tag_6: | ||
// /* "source":248:249 */ | ||
// 0x00 | ||
// /* "source":238:250 */ | ||
// dup1 | ||
// revert | ||
// /* "source":208:225 */ | ||
// tag_5: | ||
// /* "source":220:222 */ | ||
// 0x20 | ||
// /* "source":217:218 */ | ||
// 0x00 | ||
// /* "source":210:223 */ | ||
// return | ||
// /* "source":144:161 */ | ||
// tag_3: | ||
// /* "source":156:158 */ | ||
// 0x20 | ||
// /* "source":153:154 */ | ||
// 0x00 | ||
// /* "source":146:159 */ | ||
// return | ||
// /* "source":78:95 */ | ||
// tag_1: | ||
// /* "source":90:92 */ | ||
// 0x20 | ||
// /* "source":87:88 */ | ||
// 0x00 | ||
// /* "source":80:93 */ | ||
// return | ||
// Bytecode: ef000101000402000100260400000000800004600a5f8030f8e100195f8030f9e1000e5f8030fbe100035f80fd60205ff360205ff360205ff3 | ||
// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP 0x26 DIV STOP STOP STOP STOP DUP1 STOP DIV PUSH1 0xA PUSH0 DUP1 ADDRESS EXTCALL RJUMPI 0x19 PUSH0 DUP1 ADDRESS EXTDELEGATECALL RJUMPI 0xE PUSH0 DUP1 ADDRESS EXTSTATICCALL RJUMPI 0x3 PUSH0 DUP1 REVERT PUSH1 0x20 PUSH0 RETURN PUSH1 0x20 PUSH0 RETURN PUSH1 0x20 PUSH0 RETURN | ||
// SourceMappings: 74:2:0:-:0;71:1;57:9;;49:28;46:49;22:244;141:1;127:9;;111:32;108:53;22:244;205:1;191:9;;177:30;174:51;22:244;248:1;238:12;;208:17;220:2;217:1;210:13;144:17;156:2;153:1;146:13;78:17;90:2;87:1;80:13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
object "a" { | ||
code { | ||
if extcall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
if extdelegatecall(address(), 0, 0, 10) { | ||
return(0, 32) | ||
} | ||
|
||
if extstaticcall(address(), 0, 0, 10) { | ||
return(0, 32) | ||
} | ||
|
||
revert(0, 0) | ||
} | ||
} | ||
|
||
// ==== | ||
// EVMVersion: >=prague | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// TypeError 7000: (35-42): Function "extcall" expects 4 arguments but got 3. | ||
// TypeError 7000: (110-125): Function "extdelegatecall" expects 3 arguments but got 4. | ||
// TypeError 7000: (197-210): Function "extstaticcall" expects 3 arguments but got 4. |
28 changes: 28 additions & 0 deletions
28
test/libyul/yulSyntaxTests/eof/extcalls_invalid_in_legacy.yul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
object "a" { | ||
code { | ||
if extcall(address(), 0, 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
if extdelegatecall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
if extstaticcall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
revert(0, 0) | ||
} | ||
} | ||
|
||
// ==== | ||
// EVMVersion: >=prague | ||
// bytecodeFormat: legacy | ||
// ---- | ||
// TypeError 4328: (35-42): The "extcall" instruction is not available in legacy bytecode VMs. | ||
// TypeError 3950: (35-62): Expected expression to evaluate to one value, but got 0 values instead. | ||
// TypeError 4328: (113-128): The "extdelegatecall" instruction is not available in legacy bytecode VMs. | ||
// TypeError 3950: (113-145): Expected expression to evaluate to one value, but got 0 values instead. | ||
// TypeError 4328: (196-209): The "extstaticcall" instruction is not available in legacy bytecode VMs. | ||
// TypeError 3950: (196-226): Expected expression to evaluate to one value, but got 0 values instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
object "a" { | ||
code { | ||
if call(address(), 0, 0, 10) { | ||
return(0, 32) | ||
} | ||
if staticcall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
if delegatecall(address(), 0, 0) { | ||
return(0, 32) | ||
} | ||
|
||
revert(0, 0) | ||
} | ||
} | ||
|
||
// ==== | ||
// EVMVersion: >=prague | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// TypeError 9132: (35-39): The "call" instruction is only available in legacy bytecode VMs (you are currently compiling to EOF). | ||
// TypeError 3950: (35-60): Expected expression to evaluate to one value, but got 0 values instead. | ||
// TypeError 9132: (110-120): The "staticcall" instruction is only available in legacy bytecode VMs (you are currently compiling to EOF). | ||
// TypeError 3950: (110-137): Expected expression to evaluate to one value, but got 0 values instead. | ||
// TypeError 9132: (187-199): The "delegatecall" instruction is only available in legacy bytecode VMs (you are currently compiling to EOF). | ||
// TypeError 3950: (187-216): Expected expression to evaluate to one value, but got 0 values instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters