diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-06 10:14:13 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-06 10:14:13 +0000 |
commit | 2aee0d514432f05cf7baa9581d71c4366f188bce (patch) | |
tree | 380d7af9c803db5ae289c823b8e2d5cfce06b7be /bignum.c | |
parent | d1685ce96979defc6e775f1788f9afcc36ca3837 (diff) |
backport from ruby_1_8
* bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
Ito <ZXB01226@nifty.com>. [ruby-list:43012]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -99,7 +99,10 @@ static VALUE bignorm(x) VALUE x; { - if (!FIXNUM_P(x)) { + if (FIXNUM_P(x)) { + return x; + } + else if (TYPE(x) == T_BIGNUM) { long len = RBIGNUM(x)->len; BDIGIT *ds = BDIGITS(x); |