diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-08 15:48:09 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-08 15:48:09 +0000 |
commit | be2a1ad45bd7109843c88e650cba821bda718ae4 (patch) | |
tree | a5295b583b6b8866792bb2a8dc23ec2c2b914f72 /bignum.c | |
parent | 9db6beb0d08ff17880fac9559b48375be2805580 (diff) | |
download | ruby-be2a1ad45bd7109843c88e650cba821bda718ae4.tar.gz |
* bignum.c (biglsh_bang): Fix bignum digits under-run.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4425,11 +4425,11 @@ biglsh_bang(BDIGIT *xds, long xn, unsigned long shift) zds = xds + xn - 1; xn -= s1 + 1; num = BIGLO(xds[xn]<<s2); - do { + while (0 < xn) { *zds-- = num | xds[--xn]>>s3; num = BIGLO(xds[xn]<<s2); } - while (xn > 0); + assert(xds <= zds); *zds = num; for (i = s1; i > 0; --i) *zds-- = 0; |