diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-13 00:30:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-13 00:30:15 +0000 |
commit | 96c31ac787a64d9c21eb498fc8af7e85e100eb5a (patch) | |
tree | a1e2f2e759f4e2621fe14e9bd49b3aea4aad5af9 /bignum.c | |
parent | 0f71c10acbb86ea272b665b61782bf5b502c11fc (diff) |
* bignum.c (bigfixize): zero length Bignum is 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -191,7 +191,8 @@ bigfixize(VALUE x) long len = RBIGNUM_LEN(x); BDIGIT *ds = BDIGITS(x); - if (len > 0 && len*SIZEOF_BDIGITS <= sizeof(long)) { + if (len == 0) return INT2FIX(0); + if (len*SIZEOF_BDIGITS <= sizeof(long)) { long num = 0; #if 2*SIZEOF_BDIGITS > SIZEOF_LONG num = (long)ds[0]; |