Skip to content

Commit

Permalink
* ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
Browse files Browse the repository at this point in the history
  even when overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Apr 10, 2013
1 parent fa9b5bf commit 3f9e0e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Wed Apr 10 17:39:13 2013 Tanaka Akira <[email protected]>

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

Wed Apr 10 12:32:37 2013 Tanaka Akira <[email protected]>

* bignum.c (rb_ll2big): Don't overflow on signed integer negation.
Expand Down
4 changes: 3 additions & 1 deletion ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3f9e0e4

Please sign in to comment.