1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 15575:

* bignum.c (BIGZEROP): fix for longer Bignum zeros.  [ruby-Bugs-17454]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2008-06-15 10:57:55 +00:00
parent 11b262e44c
commit 870df461dd
3 changed files with 20 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Sun Jun 15 19:56:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (BIGZEROP): fix for longer Bignum zeros. [ruby-Bugs-17454]
Sun Jun 15 19:54:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (big2str_find_n1): check integer overflow.

View file

@ -36,7 +36,21 @@ VALUE rb_cBignum;
#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
#define BDIGMAX ((BDIGIT)-1)
#define BIGZEROP(x) (RBIGNUM(x)->len == 0 || (RBIGNUM(x)->len == 1 && BDIGITS(x)[0] == 0))
#define BIGZEROP(x) (RBIGNUM(x)->len == 0 || \
(BDIGITS(x)[0] == 0 && \
(RBIGNUM(x)->len == 1 || bigzero_p(x))))
static int bigzero_p(VALUE);
static int
bigzero_p(x)
VALUE x;
{
long i;
for (i = 0; i < RBIGNUM(x)->len; ++i) {
if (BDIGITS(x)[i]) return 0;
}
return 1;
}
static VALUE
bignew_1(klass, len, sign)

View file

@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080615
#define RUBY_PATCHLEVEL 184
#define RUBY_PATCHLEVEL 185
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8