ruby-changes:30246
From: akr <ko1@a...>
Date: Thu, 1 Aug 2013 01:48:18 +0900 (JST)
Subject: [ruby-changes:30246] akr:r42298 (trunk): * bignum.c (big2str_karatsuba): Fix a condition of power_level.
akr 2013-08-01 01:48:08 +0900 (Thu, 01 Aug 2013) New Revision: 42298 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42298 Log: * bignum.c (big2str_karatsuba): Fix a condition of power_level. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 42297) +++ ChangeLog (revision 42298) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Aug 1 01:45:18 2013 Tanaka Akira <akr@f...> + + * bignum.c (big2str_karatsuba): Fix a condition of power_level. + Thu Aug 1 01:09:02 2013 Tanaka Akira <akr@f...> * bignum.c (LOG2_KARATSUBA_BIG2STR_DIGITS): Removed. Index: bignum.c =================================================================== --- bignum.c (revision 42297) +++ bignum.c (revision 42298) @@ -4225,6 +4225,8 @@ big2str_orig(struct big2str_struct *b2s, https://github.com/ruby/ruby/blob/trunk/bignum.c#L4225 size_t j = len; BDIGIT* ds = BDIGITS(x); + assert(i <= 2); + while (i && j > 0) { long k = i; BDIGIT_DBL num = 0; @@ -4266,7 +4268,7 @@ big2str_karatsuba(struct big2str_struct https://github.com/ruby/ruby/blob/trunk/bignum.c#L4268 } } - if (power_level == 0) { + if (power_level < 0) { return big2str_orig(b2s, x, ptr, len, trim); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/