aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-23 18:36:47 +0800
committerobscuren <geffobscura@gmail.com>2014-07-23 18:36:47 +0800
commit958b482ada677028e11698c219ed5b1e70b224e6 (patch)
tree2d517cb19ba0de081022fc4537fa7bc2dfbcba14
parent5d57b7847105639efe1945e1ff588b1116a11a54 (diff)
downloaddexon-958b482ada677028e11698c219ed5b1e70b224e6.tar
dexon-958b482ada677028e11698c219ed5b1e70b224e6.tar.gz
dexon-958b482ada677028e11698c219ed5b1e70b224e6.tar.bz2
dexon-958b482ada677028e11698c219ed5b1e70b224e6.tar.lz
dexon-958b482ada677028e11698c219ed5b1e70b224e6.tar.xz
dexon-958b482ada677028e11698c219ed5b1e70b224e6.tar.zst
dexon-958b482ada677028e11698c219ed5b1e70b224e6.zip
div 0 err
-rw-r--r--ethvm/vm.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/ethvm/vm.go b/ethvm/vm.go
index 1f0ae8991..e159d8ff1 100644
--- a/ethvm/vm.go
+++ b/ethvm/vm.go
@@ -268,7 +268,9 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
x, y := stack.Popn()
self.Printf(" %v / %v", y, x)
- base.Div(y, x)
+ if x.Cmp(ethutil.Big0) != 0 {
+ base.Div(y, x)
+ }
self.Printf(" = %v", base)
// Pop result back on the stack