summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-09 13:44:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-09 13:44:49 +0000
commit55cbeefb2df3a3985d96a8538ac145c35665cfd3 (patch)
treed3051c0051cb4fb80283e85b6d0db7dcf234ccc7 /bignum.c
parent59d1fc36154b3a604d277d5a9a0d46f4310dad3c (diff)
* bignum.c (bary_mul_single): Invoke MEMZERO here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bignum.c b/bignum.c
index b64e477b29..b25aebdcac 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1439,6 +1439,8 @@ bary_mul_single(BDIGIT *zds, size_t zl, BDIGIT x, BDIGIT y)
n = (BDIGIT_DBL)x * y;
zds[0] = BIGLO(n);
zds[1] = (BDIGIT)BIGDN(n);
+
+ MEMZERO(zds + 2, BDIGIT, zl - 2);
}
static int
@@ -1787,16 +1789,12 @@ rb_big_mul_karatsuba(VALUE x, VALUE y)
static void
bary_mul1(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl)
{
- size_t l;
-
assert(xl + yl <= zl);
if (xl == 1 && yl == 1) {
- l = 2;
bary_mul_single(zds, zl, xds[0], yds[0]);
}
else {
- l = xl + yl;
bary_mul_normal(zds, zl, xds, xl, yds, yl);
rb_thread_check_ints();
}