summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/bigdecimal/bigdecimal.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b23da202e..582fec1707 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index d6cc409eac..f08dce40a4 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -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)