aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-22 05:26:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-22 05:26:33 +0000
commit145b7e1b8b1424f8199b772199a2cbf3e2862093 (patch)
tree52c5fe8f41c31441633a02c9a783bd1fb03f2d95
parent3647fb485cfd027d9dfe54cf9795a4cbe90ed0dd (diff)
downloadruby-145b7e1b8b1424f8199b772199a2cbf3e2862093.tar.gz
* 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
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c5
2 files changed, 8 insertions, 1 deletions
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 <matz@ruby-lang.org>
+
+ * bignum.c (bignorm): x may not be a bignum. [ruby-dev:28367]
+
Wed Feb 22 09:22:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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);