mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-11 21:04:11 +00:00
fix EVM stack.[] bug
This commit is contained in:
parent
f219c69840
commit
8b0d700b45
@ -124,7 +124,7 @@ proc `$`*(stack: Stack): string =
|
||||
&"Stack:\n{values}"
|
||||
|
||||
proc `[]`*(stack: Stack, i: BackwardsIndex, T: typedesc): T =
|
||||
# This should be used only for tracer/test/debugging
|
||||
ensurePop(stack, int(i))
|
||||
fromStackElement(stack.values[i], result)
|
||||
|
||||
proc peekInt*(stack: Stack): UInt256 =
|
||||
|
@ -124,7 +124,7 @@ proc `$`*(stack: Stack): string =
|
||||
&"Stack:\n{values}"
|
||||
|
||||
proc `[]`*(stack: Stack, i: BackwardsIndex, T: typedesc): T =
|
||||
# This should be used only for tracer/test/debugging
|
||||
ensurePop(stack, int(i))
|
||||
fromStackElement(stack.values[i], result)
|
||||
|
||||
proc peekInt*(stack: Stack): UInt256 =
|
||||
|
@ -8,6 +8,21 @@ proc opEnvMain*() =
|
||||
suite "Environmental Information Opcodes":
|
||||
let (vmState, chainDB) = initDatabase()
|
||||
|
||||
assembler: # EVM bug reported in discord
|
||||
title: "stack's operator [] bug"
|
||||
code:
|
||||
PUSH1 "0x0A"
|
||||
DUP1
|
||||
RETURNDATASIZE
|
||||
MSIZE
|
||||
ADDRESS
|
||||
GAS
|
||||
STATICCALL
|
||||
CALL
|
||||
fork: london
|
||||
success: false
|
||||
memory: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
|
||||
assembler: # CODECOPY OP
|
||||
title: "CODECOPY_1"
|
||||
code:
|
||||
|
Loading…
x
Reference in New Issue
Block a user