aboutsummaryrefslogtreecommitdiffstats
path: root/vm/execution.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/execution.go')
-rw-r--r--vm/execution.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/execution.go b/vm/execution.go
index bd174d64e..c518c4b57 100644
--- a/vm/execution.go
+++ b/vm/execution.go
@@ -36,7 +36,7 @@ func (self *Execution) exec(code, caddr []byte, caller ClosureRef) (ret []byte,
snapshot := env.State().Copy()
defer func() {
- if err != nil {
+ if IsDepthErr(err) || IsOOGErr(err) {
env.State().Set(snapshot)
}
}()
@@ -76,7 +76,7 @@ func (self *Execution) exec(code, caddr []byte, caller ClosureRef) (ret []byte,
if self.vm.Depth() == MaxCallDepth {
c.UseGas(self.Gas)
- return c.Return(nil), fmt.Errorf("Max call depth exceeded (%d)", MaxCallDepth)
+ return c.Return(nil), DepthError{}
}
// Executer the closure and get the return value (if any)