diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-23 18:04:27 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-23 18:04:27 +0800 |
commit | 06ec80f39495bdd92878468cf862f52e9748f1ca (patch) | |
tree | 85f917581ef39480b5078c591cb616beafefaba6 | |
parent | 6774ddaba29ae9e9db5065ce74055297b948adf9 (diff) | |
download | go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.tar go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.tar.gz go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.tar.bz2 go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.tar.lz go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.tar.xz go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.tar.zst go-tangerine-06ec80f39495bdd92878468cf862f52e9748f1ca.zip |
zero devision check
-rw-r--r-- | ethchain/vm.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go index 528088a49..07e9a0f2c 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -306,7 +306,9 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) { x, y := stack.Popn() vm.Printf(" %v / %v", y, x) - base.Div(y, x) + if x.Cmp(ethutil.Big0) != 0 { + base.Div(y, x) + } vm.Printf(" = %v", base) // Pop result back on the stack |