EIP-1153: Fix tload stack underflow bug
This commit is contained in:
parent
a72141ccdf
commit
19ace7309a
|
@ -289,9 +289,9 @@ const
|
|||
tloadOp: Vm2OpFn = proc (k: var Vm2Ctx) =
|
||||
## 0x5c, Load word from transient storage.
|
||||
let
|
||||
slot = k.cpt.stack.peek()
|
||||
slot = k.cpt.stack.popInt()
|
||||
val = k.cpt.getTransientStorage(slot)
|
||||
k.cpt.stack.top(val)
|
||||
k.cpt.stack.push: val
|
||||
|
||||
tstoreOp: Vm2OpFn = proc (k: var Vm2Ctx) =
|
||||
## 0x5d, Save word to transient storage.
|
||||
|
|
|
@ -920,5 +920,27 @@ proc opMemoryMain*() =
|
|||
"0x0000010203040506070000000000000000000000000000000000000000000000"
|
||||
fork: Cancun
|
||||
|
||||
assembler:
|
||||
title: "TSTORE/TLOAD"
|
||||
code:
|
||||
PUSH1 "0xAA"
|
||||
PUSH1 "0xBB"
|
||||
TSTORE
|
||||
PUSH1 "0xBB"
|
||||
TLOAD
|
||||
stack:
|
||||
"0x00000000000000000000000000000000000000000000000000000000000000AA"
|
||||
fork: Cancun
|
||||
|
||||
assembler:
|
||||
title: "TLOAD stack underflow not crash"
|
||||
code:
|
||||
PUSH1 "0xAA"
|
||||
PUSH1 "0xBB"
|
||||
TSTORE
|
||||
TLOAD
|
||||
success: false
|
||||
fork: Cancun
|
||||
|
||||
when isMainModule:
|
||||
opMemoryMain()
|
||||
|
|
Loading…
Reference in New Issue