summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-11-24 01:24:51 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-11-24 01:24:51 +0000
commite3adeba5b2ceef912e36ee9d95678c4e22458a26 (patch)
tree444cb138a45995395da9633ad0296a8d906d87e2 /bignum.c
parent7505c10b731e6489d0d1b606071cab25881fb7d3 (diff)
* 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@11306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 552648c631..cc3dd1e5c3 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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);