aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);