mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
core/vm: nil check memorySize instead of dynamicGas
We have the assumption that if an opcode has memorySize function then it has dynamicGas function. And we check that condition of every opcode in validate function. But in the interpreter, we actually assume that if an opcode has dynamicGas then it has memorySize function. However, it is still correct as every opcode currently have either these 2 functions or none. So this commit is trivial, to make the interpreter consistent with asssumption in validate function to avoid confusion.
This commit is contained in:
parent
341647f186
commit
384ba784c5
1 changed files with 1 additions and 1 deletions
|
|
@ -258,7 +258,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
|
|||
contract.Gas -= cost
|
||||
}
|
||||
|
||||
if operation.dynamicGas != nil {
|
||||
if operation.memorySize != nil {
|
||||
// All ops with a dynamic memory usage also has a dynamic gas cost.
|
||||
var memorySize uint64
|
||||
// calculate the new memory size and expand the memory to fit
|
||||
|
|
|
|||
Loading…
Reference in a new issue