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

ruby-changes:29892

From: nagachika <ko1@a...>
Date: Sat, 13 Jul 2013 23:25:47 +0900 (JST)
Subject: [ruby-changes:29892] nagachika:r41944 (ruby_2_0_0): merge revision(s) 41839,41841:

nagachika	2013-07-13 23:25:36 +0900 (Sat, 13 Jul 2013)

  New Revision: 41944

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

  Log:
    merge revision(s) 41839,41841:
    
    * bignum.c (biglsh_bang): Fix bignum digits under-run.
    
    * bignum.c (bigrsh_bang): Fix bignum digits overrun.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/bignum.c
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 41943)
+++ ruby_2_0_0/ChangeLog	(revision 41944)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sat Jul 13 23:16:49 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (bigrsh_bang): Fix bignum digits overrun.
+
+Sat Jul 13 23:16:49 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (biglsh_bang): Fix bignum digits under-run.
+
 Sat Jul 13 22:45:10 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (RUBY_DTRACE_POSTPROCESS): dtrace version SUN D 1.11
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 41943)
+++ ruby_2_0_0/version.h	(revision 41944)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-07-13"
-#define RUBY_PATCHLEVEL 257
+#define RUBY_PATCHLEVEL 258
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 7
Index: ruby_2_0_0/bignum.c
===================================================================
--- ruby_2_0_0/bignum.c	(revision 41943)
+++ ruby_2_0_0/bignum.c	(revision 41944)
@@ -2335,11 +2335,11 @@ biglsh_bang(BDIGIT *xds, long xn, unsign https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/bignum.c#L2335
     zds = xds + xn - 1;
     xn -= s1 + 1;
     num = xds[xn]<<s2;
-    do {
+    while (0 < xn) {
 	*zds-- = num | xds[--xn]>>s3;
 	num = xds[xn]<<s2;
     }
-    while (xn > 0);
+    assert(xds <= zds);
     *zds = num;
     for (i = s1; i > 0; --i)
 	*zds-- = 0;
@@ -2362,11 +2362,11 @@ bigrsh_bang(BDIGIT* xds, long xn, unsign https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/bignum.c#L2362
     i = 0;
     zds = xds + s1;
     num = *zds++>>s2;
-    do {
+    while (i < xn - s1 - 1) {
 	xds[i++] = (BDIGIT)(*zds<<s3) | num;
 	num = *zds++>>s2;
     }
-    while (i < xn - s1 - 1);
+    assert(i < xn);
     xds[i] = num;
     MEMZERO(xds + xn - s1, BDIGIT, s1);
 }

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r41839,41841


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

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