1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable

even when overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-04-10 08:39:53 +00:00
parent fa9b5bf223
commit 3f9e0e43c3
2 changed files with 8 additions and 1 deletions
ChangeLog
ext/bigdecimal

View file

@ -1,3 +1,8 @@
Wed Apr 10 17:39:13 2013 Tanaka Akira <akr@fsij.org>
* ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
even when overflow.
Wed Apr 10 12:32:37 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (rb_ll2big): Don't overflow on signed integer negation.

View file

@ -5270,8 +5270,10 @@ VpCtoV(Real *a, const char *int_chr, size_t ni, const char *frac, size_t nf, con
++me;
}
while (i < me) {
if (MUL_OVERFLOW_SIGNED_VALUE_P(e, (SIGNED_VALUE)BASE_FIG))
if (MUL_OVERFLOW_SIGNED_VALUE_P(e, (SIGNED_VALUE)BASE_FIG)) {
es = e;
goto exp_overflow;
}
es = e * (SIGNED_VALUE)BASE_FIG;
if (MUL_OVERFLOW_SIGNED_VALUE_P(e, 10) ||
SIGNED_VALUE_MAX - (exp_chr[i] - '0') < e * 10)