mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fix bug when 0 * other object
This commit is contained in:
+1
-1
@@ -690,10 +690,10 @@ mrb_fixnum_mul(mrb_state *mrb, mrb_value x, mrb_value y)
|
||||
mrb_int a;
|
||||
|
||||
a = mrb_fixnum(x);
|
||||
if (a == 0) return x;
|
||||
if (mrb_fixnum_p(y)) {
|
||||
mrb_int b, c;
|
||||
|
||||
if (a == 0) return x;
|
||||
b = mrb_fixnum(y);
|
||||
if (FIT_SQRT_INT(a) && FIT_SQRT_INT(b))
|
||||
return mrb_fixnum_value(a*b);
|
||||
|
||||
Reference in New Issue
Block a user