summaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-21 15:33:32 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-21 15:33:32 +0000
commit0dd67dc72b173fc52998eb10c9fe0028d42ff86c (patch)
tree62e8db587744056f804514091704437327a67939 /bignum.c
parenteb671f238654301a51e8c44ab2a6a34afcc0b5aa (diff)
downloadruby-0dd67dc72b173fc52998eb10c9fe0028d42ff86c.tar.gz
ruby-0dd67dc72b173fc52998eb10c9fe0028d42ff86c.tar.xz
ruby-0dd67dc72b173fc52998eb10c9fe0028d42ff86c.zip
* bignum.c (big_shift): fix a bug that caused infinite loop when
left shifting. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 8b694d91a..5ed026acd 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1851,7 +1851,7 @@ static VALUE big_rshift(VALUE, unsigned long);
static VALUE big_shift(VALUE x, int n)
{
if (n < 0)
- return big_lshift(x, (unsigned int)n);
+ return big_lshift(x, (unsigned int)-n);
else if (n > 0)
return big_rshift(x, (unsigned int)n);
return x;