Skip to content

Commit

Permalink
core/vm: move TSTORE,TLOAD to correct opcode nums (ethereum#27613)
Browse files Browse the repository at this point in the history
* core/vm: move TSTORE,TLOAD to correct opcode nums

* core/vm: cleanup
  • Loading branch information
MariusVanDerWijden authored and NazariiDenha committed Apr 25, 2024
1 parent 6054db8 commit 84914fb
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions core/vm/opcodes.go
Expand Up @@ -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
)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -309,6 +305,8 @@ var opCodeToString = map[OpCode]string{
MSIZE: "MSIZE",
GAS: "GAS",
JUMPDEST: "JUMPDEST",
TLOAD: "TLOAD",
TSTORE: "TSTORE",
MCOPY: "MCOPY",
PUSH0: "PUSH0",

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 84914fb

Please sign in to comment.