aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/interpreter.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/interpreter.go')
-rw-r--r--core/vm/interpreter.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go
index 23f930e91..0466bf085 100644
--- a/core/vm/interpreter.go
+++ b/core/vm/interpreter.go
@@ -209,24 +209,22 @@ func (in *Interpreter) Run(snapshot int, contract *Contract, input []byte) (ret
if verifyPool {
verifyIntegerPool(in.intPool)
}
- // checks whether the operation should revert state.
- if operation.reverts {
- in.evm.StateDB.RevertToSnapshot(snapshot)
+ // 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.returns {
+ in.returnData = res
}
switch {
case err != nil:
return nil, err
+ case operation.reverts:
+ return res, errExecutionReverted
case operation.halts:
return res, nil
case !operation.jumps:
pc++
}
- // 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.returns {
- in.returnData = res
- }
}
return nil, nil
}