diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-16 18:36:48 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-16 18:43:14 +0800 |
commit | 4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6 (patch) | |
tree | 83afa01b7768105ad8f6b76ff13c07232f3a369e /core/vm/interpreter.go | |
parent | 9bd6068fefe5687735bed342f3545f515fa717c8 (diff) | |
download | dexon-4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6.tar.gz dexon-4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6.tar.zst dexon-4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6.zip |
core/vm: polish RETURNDATA, add missing returns to CALL*
Diffstat (limited to 'core/vm/interpreter.go')
-rw-r--r-- | core/vm/interpreter.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 1c7481bc5..954839f2e 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -59,9 +59,8 @@ type Interpreter struct { gasTable params.GasTable intPool *intPool - readonly bool - // returnData contains the last call's return data - returnData []byte + readOnly bool // Whether to throw on stateful modifications + returnData []byte // Last CALL's return data for subsequent reuse } // NewInterpreter returns a new instance of the Interpreter. @@ -90,7 +89,7 @@ func NewInterpreter(evm *EVM, cfg Config) *Interpreter { func (in *Interpreter) enforceRestrictions(op OpCode, operation operation, stack *Stack) error { if in.evm.chainRules.IsMetropolis { - if in.readonly { + if in.readOnly { // If the interpreter is operating in readonly mode, make sure no // state-modifying operation is performed. The 3rd stack item // for a call operation is the value. Transfering value from one @@ -221,7 +220,7 @@ func (in *Interpreter) Run(snapshot int, contract *Contract, input []byte) (ret } // if the operation clears the return data (e.g. it has returning data) // set the last return to the result of the operation. - if operation.clearsReturndata { + if operation.returns { in.returnData = res } } |