diff --git a/libevmasm/Instruction.h b/libevmasm/Instruction.h index 511e3cf1b..67a77f0c9 100644 --- a/libevmasm/Instruction.h +++ b/libevmasm/Instruction.h @@ -174,16 +174,16 @@ enum class Instruction: uint8_t LOG3, ///< Makes a log entry; 3 topics. LOG4, ///< Makes a log entry; 4 topics. - JUMPTO = 0xb0, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp - JUMPIF, ///< conditionally alter the program counter -- not part of Instructions.cpp - JUMPV, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp - JUMPSUB, ///< alter the program counter to a beginsub -- not part of Instructions.cpp - JUMPSUBV, ///< alter the program counter to a beginsub -- not part of Instructions.cpp - BEGINSUB, ///< set a potential jumpsub destination -- not part of Instructions.cpp - BEGINDATA, ///< begin the data section -- not part of Instructions.cpp - RETURNSUB, ///< return to subroutine jumped from -- not part of Instructions.cpp - PUTLOCAL, ///< pop top of stack to local variable -- not part of Instructions.cpp - GETLOCAL, ///< push local variable to top of stack -- not part of Instructions.cpp + EIP615_JUMPTO = 0xb0, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp + EIP615_JUMPIF, ///< conditionally alter the program counter -- not part of Instructions.cpp + EIP615_JUMPV, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp + EIP615_JUMPSUB, ///< alter the program counter to a beginsub -- not part of Instructions.cpp + EIP615_JUMPSUBV, ///< alter the program counter to a beginsub -- not part of Instructions.cpp + EIP615_BEGINSUB, ///< set a potential jumpsub destination -- not part of Instructions.cpp + EIP615_BEGINDATA, ///< begin the data section -- not part of Instructions.cpp + EIP615_RETURNSUB, ///< return to subroutine jumped from -- not part of Instructions.cpp + EIP615_PUTLOCAL, ///< pop top of stack to local variable -- not part of Instructions.cpp + EIP615_GETLOCAL, ///< push local variable to top of stack -- not part of Instructions.cpp CREATE = 0xf0, ///< create a new account with associated code CALL, ///< message-call into an account diff --git a/libyul/backends/evm/EVMAssembly.cpp b/libyul/backends/evm/EVMAssembly.cpp index 73194ef8a..7cf3d0662 100644 --- a/libyul/backends/evm/EVMAssembly.cpp +++ b/libyul/backends/evm/EVMAssembly.cpp @@ -102,7 +102,7 @@ void EVMAssembly::appendJumpTo(LabelID _labelId, int _stackDiffAfter, JumpType _ { if (m_evm15) { - m_bytecode.push_back(uint8_t(evmasm::Instruction::JUMPTO)); + m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPTO)); appendLabelReferenceInternal(_labelId); m_stackHeight += _stackDiffAfter; } @@ -117,7 +117,7 @@ void EVMAssembly::appendJumpToIf(LabelID _labelId, JumpType) { if (m_evm15) { - m_bytecode.push_back(uint8_t(evmasm::Instruction::JUMPIF)); + m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPIF)); appendLabelReferenceInternal(_labelId); m_stackHeight--; } @@ -133,7 +133,7 @@ void EVMAssembly::appendBeginsub(LabelID _labelId, int _arguments) yulAssert(m_evm15, "BEGINSUB used for EVM 1.0"); yulAssert(_arguments >= 0, ""); setLabelToCurrentPosition(_labelId); - m_bytecode.push_back(uint8_t(evmasm::Instruction::BEGINSUB)); + m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_BEGINSUB)); m_stackHeight += _arguments; } @@ -141,7 +141,7 @@ void EVMAssembly::appendJumpsub(LabelID _labelId, int _arguments, int _returns) { yulAssert(m_evm15, "JUMPSUB used for EVM 1.0"); yulAssert(_arguments >= 0 && _returns >= 0, ""); - m_bytecode.push_back(uint8_t(evmasm::Instruction::JUMPSUB)); + m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPSUB)); appendLabelReferenceInternal(_labelId); m_stackHeight += _returns - _arguments; } @@ -150,7 +150,7 @@ void EVMAssembly::appendReturnsub(int _returns, int _stackDiffAfter) { yulAssert(m_evm15, "RETURNSUB used for EVM 1.0"); yulAssert(_returns >= 0, ""); - m_bytecode.push_back(uint8_t(evmasm::Instruction::RETURNSUB)); + m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_RETURNSUB)); m_stackHeight += _stackDiffAfter - _returns; } diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp index c17fa33e8..956db124f 100644 --- a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp +++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp @@ -409,17 +409,17 @@ u256 EVMInstructionInterpreter::eval( case Instruction::SWAP14: case Instruction::SWAP15: case Instruction::SWAP16: - // --------------- EVM 2.0 --------------- - case Instruction::JUMPTO: - case Instruction::JUMPIF: - case Instruction::JUMPV: - case Instruction::JUMPSUB: - case Instruction::JUMPSUBV: - case Instruction::BEGINSUB: - case Instruction::BEGINDATA: - case Instruction::RETURNSUB: - case Instruction::PUTLOCAL: - case Instruction::GETLOCAL: + // --------------- EIP-615 --------------- + case Instruction::EIP615_JUMPTO: + case Instruction::EIP615_JUMPIF: + case Instruction::EIP615_JUMPV: + case Instruction::EIP615_JUMPSUB: + case Instruction::EIP615_JUMPSUBV: + case Instruction::EIP615_BEGINSUB: + case Instruction::EIP615_BEGINDATA: + case Instruction::EIP615_RETURNSUB: + case Instruction::EIP615_PUTLOCAL: + case Instruction::EIP615_GETLOCAL: { yulAssert(false, ""); return 0;