From 145b7e1b8b1424f8199b772199a2cbf3e2862093 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 22 Feb 2006 05:26:33 +0000 Subject: [PATCH] * bignum.c (bignorm): x may not be a bignum. [ruby-dev:28367] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ bignum.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 714ceec3bf..1b18143237 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 22 14:21:03 2006 Yukihiro Matsumoto + + * bignum.c (bignorm): x may not be a bignum. [ruby-dev:28367] + Wed Feb 22 09:22:40 2006 Yukihiro Matsumoto * eval.c (proc_alloc): add proper check for creation of a lambda diff --git a/bignum.c b/bignum.c index 587564929b..9cf7a3702f 100644 --- a/bignum.c +++ b/bignum.c @@ -92,7 +92,10 @@ rb_big_2comp(VALUE x) /* get 2's complement */ static VALUE bignorm(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);