summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index 62594358d..04a65f26e 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1360,7 +1360,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
x = mrb_fixnum(regs[a]);
y = mrb_fixnum(regs[a+1]);
z = x * y;
- if (z/x != y) {
+ if (x != 0 && z/x != y) {
regs[a] = mrb_float_value((mrb_float)x * (mrb_float)y);
}
else {