From 84914fb6c6b5dcab3ee0cbcb55b1be39e78e5f73 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Tue, 27 Jun 2023 09:25:08 +0200 Subject: [PATCH] core/vm: move TSTORE,TLOAD to correct opcode nums (#27613) * core/vm: move TSTORE,TLOAD to correct opcode nums * core/vm: cleanup --- core/vm/opcodes.go | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/core/vm/opcodes.go b/core/vm/opcodes.go index 987f185def4bf..10a995b910c2f 100644 --- a/core/vm/opcodes.go +++ b/core/vm/opcodes.go @@ -120,6 +120,8 @@ const ( MSIZE OpCode = 0x59 GAS OpCode = 0x5a JUMPDEST OpCode = 0x5b + TLOAD OpCode = 0x5c + TSTORE OpCode = 0x5d MCOPY OpCode = 0x5e PUSH0 OpCode = 0x5f ) @@ -224,12 +226,6 @@ const ( SELFDESTRUCT OpCode = 0xff ) -// 0xb0 range. -const ( - TLOAD OpCode = 0xb3 - TSTORE OpCode = 0xb4 -) - // Since the opcodes aren't all in order we can't use a regular slice. var opCodeToString = map[OpCode]string{ // 0x0 range - arithmetic ops. @@ -309,6 +305,8 @@ var opCodeToString = map[OpCode]string{ MSIZE: "MSIZE", GAS: "GAS", JUMPDEST: "JUMPDEST", + TLOAD: "TLOAD", + TSTORE: "TSTORE", MCOPY: "MCOPY", PUSH0: "PUSH0", @@ -385,11 +383,7 @@ var opCodeToString = map[OpCode]string{ LOG3: "LOG3", LOG4: "LOG4", - // 0xb0 range. - TLOAD: "TLOAD", - TSTORE: "TSTORE", - - // 0xf0 range. + // 0xf0 range CREATE: "CREATE", CALL: "CALL", RETURN: "RETURN", @@ -478,10 +472,10 @@ var stringToOp = map[string]OpCode{ "MSIZE": MSIZE, "GAS": GAS, "JUMPDEST": JUMPDEST, - "MCOPY": MCOPY, - "PUSH0": PUSH0, "TLOAD": TLOAD, "TSTORE": TSTORE, + "MCOPY": MCOPY, + "PUSH0": PUSH0, "PUSH1": PUSH1, "PUSH2": PUSH2, "PUSH3": PUSH3,