summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
authorCarson McDonald <[email protected]>2014-05-13 11:46:29 -0400
committerCarson McDonald <[email protected]>2014-05-13 11:46:29 -0400
commit01988e3be7554c0743b8f8b4913bce828f360e35 (patch)
tree71baf3433fa144798251891202ad426dfa33b035 /src/numeric.c
parent33b2975c9d00df93292865ff8491da6af36214a2 (diff)
downloadmruby-01988e3be7554c0743b8f8b4913bce828f360e35.tar.gz
mruby-01988e3be7554c0743b8f8b4913bce828f360e35.zip
Make sure c is large enough if there is an overflow
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 8af7bfd15..b3daddf85 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -702,7 +702,8 @@ mrb_fixnum_mul(mrb_state *mrb, mrb_value x, mrb_value y)
a = mrb_fixnum(x);
if (mrb_fixnum_p(y)) {
- mrb_int b, c;
+ mrb_float c;
+ mrb_int b;
if (a == 0) return x;
b = mrb_fixnum(y);