mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
* bignum.c (bigrsh_bang): Fix bignum digits overrun.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2db6f96cd0
commit
fa1e85c933
2 changed files with 6 additions and 2 deletions
4
bignum.c
4
bignum.c
|
@ -4452,11 +4452,11 @@ bigrsh_bang(BDIGIT* xds, long xn, unsigned long shift)
|
|||
i = 0;
|
||||
zds = xds + s1;
|
||||
num = *zds++>>s2;
|
||||
do {
|
||||
while (i < xn - s1 - 1) {
|
||||
xds[i++] = BIGLO(*zds<<s3) | num;
|
||||
num = *zds++>>s2;
|
||||
}
|
||||
while (i < xn - s1 - 1);
|
||||
assert(i < xn);
|
||||
xds[i] = num;
|
||||
MEMZERO(xds + xn - s1, BDIGIT, s1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue