From 2aee0d514432f05cf7baa9581d71c4366f188bce Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 6 Dec 2006 10:14:13 +0000 Subject: backport from ruby_1_8 * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki Ito . [ruby-list:43012] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ bignum.c | 5 ++++- version.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07e5adcf1b..db566b17f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,11 @@ Sun Nov 26 16:36:46 2006 URABE Shyouhei * version.h: addition of RUBY_PATCHLEVEL. * version.c: ditto. +Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto + + * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki + Ito . [ruby-list:43012] + Thu Nov 2 15:43:39 2006 NAKAMURA Usaku * parse.y (primary): should set NODE even when compstmt is NULL. diff --git a/bignum.c b/bignum.c index 6a7a83c085..493550ff98 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); diff --git a/version.h b/version.h index eb9ef531ae..e792de4380 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2006-12-06" #define RUBY_VERSION_CODE 185 #define RUBY_RELEASE_CODE 20061206 -#define RUBY_PATCHLEVEL 5 +#define RUBY_PATCHLEVEL 6 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit v1.2.3