diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-17 00:14:16 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-17 00:14:16 +0900 |
| commit | 5140e27b5a970d717138fe0b15b20e345f7ea5f6 (patch) | |
| tree | 004ccdf96f3220088aa11b6b05f4c727da5f9adf /src/numeric.c | |
| parent | 777d460fb8cdf6108d9b9cb260adf9665789bc23 (diff) | |
| parent | 9dcce29749db652ca22a3ffb28a56c1c0f04572d (diff) | |
| download | mruby-5140e27b5a970d717138fe0b15b20e345f7ea5f6.tar.gz mruby-5140e27b5a970d717138fe0b15b20e345f7ea5f6.zip | |
Merge pull request #1872 from ksss/numeric-mul
fix bug when `0 * other object`
Diffstat (limited to 'src/numeric.c')
| -rw-r--r-- | src/numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c index e2af14b97..066c5e154 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -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); |
