zero check before overflow check devision; close #446

This commit is contained in:
Yukihiro Matsumoto
2012-09-03 21:13:19 +09:00
parent dabe3ca0c7
commit 7d1673276c
+1 -1
View File
@@ -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 {