diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-23 20:04:00 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-23 20:04:00 +0800 |
commit | feef194829b07570e91873ed5d1e8cc51e8fa430 (patch) | |
tree | 7ccb57a57bc538c8ae242fcad95f96218b21862e /vm/execution.go | |
parent | 91c876831a3b616beb759c30d705407845ffc3ee (diff) | |
download | go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.tar go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.tar.gz go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.tar.bz2 go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.tar.lz go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.tar.xz go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.tar.zst go-tangerine-feef194829b07570e91873ed5d1e8cc51e8fa430.zip |
Chnged to use GetOp instead & added error + checking
Diffstat (limited to 'vm/execution.go')
-rw-r--r-- | vm/execution.go | 4 |
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) |