mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 21:34:33 +00:00
fix vm oog problem
This commit is contained in:
parent
dcf7699358
commit
b198ffee2d
@ -590,6 +590,8 @@ op create, inline = false, value, startPosition, size:
|
|||||||
push: 0
|
push: 0
|
||||||
else:
|
else:
|
||||||
push: contractAddress
|
push: contractAddress
|
||||||
|
|
||||||
|
if not childComputation.shouldBurnGas:
|
||||||
computation.gasMeter.returnGas(childComputation.gasMeter.gasRemaining)
|
computation.gasMeter.returnGas(childComputation.gasMeter.gasRemaining)
|
||||||
|
|
||||||
proc callParams(computation: var BaseComputation): (UInt256, UInt256, EthAddress, EthAddress, EthAddress, UInt256, UInt256, UInt256, UInt256, MsgFlags) =
|
proc callParams(computation: var BaseComputation): (UInt256, UInt256, EthAddress, EthAddress, EthAddress, UInt256, UInt256, UInt256, UInt256, MsgFlags) =
|
||||||
@ -710,8 +712,12 @@ template genCall(callName: untyped, opCode: Op): untyped =
|
|||||||
))
|
))
|
||||||
|
|
||||||
trace "Call (" & callName.astToStr & ")", childGasLimit, childGasFee
|
trace "Call (" & callName.astToStr & ")", childGasLimit, childGasFee
|
||||||
|
if childGasFee >= 0:
|
||||||
computation.gasMeter.consumeGas(childGasFee, reason = $opCode)
|
computation.gasMeter.consumeGas(childGasFee, reason = $opCode)
|
||||||
|
|
||||||
|
if childGasFee < 0 and childGasLimit <= 0:
|
||||||
|
raise newException(OutOfGas, "Gas not enough to perform calculation (" & callName.astToStr & ")")
|
||||||
|
|
||||||
computation.memory.extend(memInPos, memInLen)
|
computation.memory.extend(memInPos, memInLen)
|
||||||
computation.memory.extend(memOutPos, memOutLen)
|
computation.memory.extend(memOutPos, memOutLen)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user