diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bignum.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki + Ito <ZXB01226@nifty.com>. [ruby-list:43012] + Thu Nov 23 10:38:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (rb_mod_define_method): set implicit visibility only when @@ -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); |