Skip to content

Commit

Permalink
eof: Fix legacy staticcall error for EOF. Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Dec 6, 2024
1 parent 9ec58fa commit b292de4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions libyul/AsmAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocatio
_instr == evmasm::Instruction::CALL ||
_instr == evmasm::Instruction::CALLCODE ||
_instr == evmasm::Instruction::DELEGATECALL ||
_instr == evmasm::Instruction::STATICCALL ||
_instr == evmasm::Instruction::SELFDESTRUCT ||
_instr == evmasm::Instruction::JUMP ||
_instr == evmasm::Instruction::JUMPI ||
Expand Down
17 changes: 17 additions & 0 deletions test/libyul/yulSyntaxTests/eof/legacy_calls_in_eof.yul
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
object "a" {
code {
pop(call(address(), 0, 0, 10))
pop(staticcall(address(), 0, 0))
pop(delegatecall(address(), 0, 0))
}
}

// ====
// bytecodeFormat: >=EOFv1
// ----
// TypeError 9132: (36-40): The "call" instruction is only available in legacy bytecode VMs (you are currently compiling to EOF).
// TypeError 3950: (36-61): Expected expression to evaluate to one value, but got 0 values instead.
// TypeError 9132: (75-85): The "staticcall" instruction is only available in legacy bytecode VMs (you are currently compiling to EOF).
// TypeError 3950: (75-102): Expected expression to evaluate to one value, but got 0 values instead.
// TypeError 9132: (116-128): The "delegatecall" instruction is only available in legacy bytecode VMs (you are currently compiling to EOF).
// TypeError 3950: (116-145): Expected expression to evaluate to one value, but got 0 values instead.

0 comments on commit b292de4

Please sign in to comment.