aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 16:48:08 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 16:48:08 +0000
commiteed6c15a21a9f843d8786254a935197502a9fccb (patch)
treeb3c16c9c5d120396ff9a308865113494182ff984 /bignum.c
parentb4dd68ff96ce1929b4fcd2aaa56722f194fe7ecf (diff)
downloadruby-eed6c15a21a9f843d8786254a935197502a9fccb.tar.gz
* bignum.c (big2str_karatsuba): Fix a condition of power_level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index cd3f6d3f44..5e6c337723 100644
--- a/bignum.c
+++ b/bignum.c
@@ -4225,6 +4225,8 @@ big2str_orig(struct big2str_struct *b2s, VALUE x, char* ptr, size_t len, int tri
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 *b2s, VALUE x, char* ptr,
}
}
- if (power_level == 0) {
+ if (power_level < 0) {
return big2str_orig(b2s, x, ptr, len, trim);
}