mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-25 18:35:32 +00:00
returnStack: use seq[int] instead of Uint256 Stack
This commit is contained in:
parent
a263e6b1a6
commit
56bc1205e5
@ -144,7 +144,7 @@ proc newComputation*(vmState: BaseVMState, message: Message, salt= 0.u256): Comp
|
||||
result.msg = message
|
||||
result.memory = Memory()
|
||||
result.stack = newStack()
|
||||
result.returnStack = newStack()
|
||||
result.returnStack = @[]
|
||||
result.gasMeter.init(message.gas)
|
||||
result.touchedAccounts = initHashSet[EthAddress]()
|
||||
result.suicides = initHashSet[EthAddress]()
|
||||
|
@ -553,7 +553,7 @@ op returnSub, inline = true:
|
||||
# Other than the check that the return stack is not empty, there is no
|
||||
# need to validate the pc from 'returns', since we only ever push valid
|
||||
# values onto it via jumpsub.
|
||||
c.code.pc = c.returnStack.popInt().safeInt
|
||||
c.code.pc = c.returnStack.pop()
|
||||
|
||||
op jumpSub, inline = true, jumpTarget:
|
||||
## 0x5e, Transfers control to a subroutine.
|
||||
@ -571,7 +571,7 @@ op jumpSub, inline = true, jumpTarget:
|
||||
if c.returnStack.len == 1023:
|
||||
raise newException(FullStack, "Out of returnStack")
|
||||
|
||||
c.returnStack.push returnPC
|
||||
c.returnStack.add returnPC
|
||||
inc c.code.pc
|
||||
|
||||
# ##########################################
|
||||
|
@ -68,7 +68,7 @@ type
|
||||
msg*: Message
|
||||
memory*: Memory
|
||||
stack*: Stack
|
||||
returnStack*: Stack
|
||||
returnStack*: seq[int]
|
||||
gasMeter*: GasMeter
|
||||
code*: CodeStream
|
||||
output*: seq[byte]
|
||||
|
Loading…
x
Reference in New Issue
Block a user