[前][次][番号順一覧][スレッド一覧]

ruby-changes:28163

From: akr <ko1@a...>
Date: Wed, 10 Apr 2013 17:40:06 +0900 (JST)
Subject: [ruby-changes:28163] akr:r40215 (trunk): * ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable

akr	2013-04-10 17:39:53 +0900 (Wed, 10 Apr 2013)

  New Revision: 40215

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40215

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

  Modified files:
    trunk/ChangeLog
    trunk/ext/bigdecimal/bigdecimal.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40214)
+++ ChangeLog	(revision 40215)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Apr 10 17:39:13 2013  Tanaka Akira  <akr@f...>
+
+	* ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
+	  even when overflow.
+
 Wed Apr 10 12:32:37 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (rb_ll2big): Don't overflow on signed integer negation.
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 40214)
+++ ext/bigdecimal/bigdecimal.c	(revision 40215)
@@ -5270,8 +5270,10 @@ VpCtoV(Real *a, const char *int_chr, siz https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L5270
 	    ++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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]