summaryrefslogtreecommitdiffstats
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
commit8188c06e4587058d3da646701c3f07b0e59c2b9d (patch)
tree444cb138a45995395da9633ad0296a8d906d87e2
parentf699322a0b12dbd77aeb04fc22c26ad041a66a8d (diff)
downloadruby-8188c06e4587058d3da646701c3f07b0e59c2b9d.tar.gz
ruby-8188c06e4587058d3da646701c3f07b0e59c2b9d.tar.xz
ruby-8188c06e4587058d3da646701c3f07b0e59c2b9d.zip
* bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
Ito <ZXB01226@nifty.com>. [ruby-list:43012] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@11306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 37c0a24b5..13c8592fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/bignum.c b/bignum.c
index 552648c63..cc3dd1e5c 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);