core/vm: optimize mstore a bit

This commit is contained in:
Martin Holst Swende 2019-10-23 16:09:27 +02:00
parent 8d39aed22c
commit c9ff3e1680
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -602,11 +602,9 @@ func opPop(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *
}
func opMload(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
offset := stack.pop()
val := interpreter.intPool.get().SetBytes(memory.Get(offset.Int64(), 32))
stack.push(val)
interpreter.intPool.put(offset)
v := stack.peek()
offset := v.Int64()
v.SetBytes(memory.GetPtr(offset, 32))
return nil, nil
}