aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-04 11:23:05 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-04 11:23:05 +0000
commitdd95c9b1cdab684e10f5fe94c53334f35781b855 (patch)
tree9b8cda140e22f1a69ffd14cee24510c128cc4f87 /bignum.c
parent35f11f306d43798fa4f203b2c1c387fcda93ce25 (diff)
downloadruby-dd95c9b1cdab684e10f5fe94c53334f35781b855.tar.gz
* bignum.c (bigdivrem_normal): Add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 039b56c597..ab702082b2 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2640,6 +2640,9 @@ bigdivrem_normal(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, BDIGIT *y
{
int shift;
+ assert(zn == xn + 1);
+ assert(yn < xn || (xn == yn && yds[yn - 1] <= xds[xn - 1]));
+
shift = nlz(yds[yn-1]);
if (shift) {
bary_small_lshift(yds, yds, yn, shift);