summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c7
-rw-r--r--version.h4
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ea9212bc6..88ff3e9b03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Feb 15 13:36:58 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (rb_big_rshift): should properly convert the nagative
+ value to 2's compliment.
+
Tue Feb 12 01:21:34 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (assignable): should emit CVASGN within the method
diff --git a/bignum.c b/bignum.c
index 2c70b4b8f0..69d69d6f1c 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1293,6 +1293,10 @@ rb_big_rshift(x, y)
else
return INT2FIX(-1);
}
+ if (!RBIGNUM(x)->sign) {
+ x = rb_big_clone(x);
+ rb_big_2comp(x);
+ }
xds = BDIGITS(x);
i = RBIGNUM(x)->len; j = i - s1;
z = bignew(j, RBIGNUM(x)->sign);
@@ -1302,6 +1306,9 @@ rb_big_rshift(x, y)
zds[j] = BIGLO(num);
num = BIGUP(xds[i]);
}
+ if (!RBIGNUM(x)->sign) {
+ rb_big_2comp(z);
+ }
return bignorm(z);
}
diff --git a/version.h b/version.h
index 548495586f..557beed565 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.6"
-#define RUBY_RELEASE_DATE "2002-02-14"
+#define RUBY_RELEASE_DATE "2002-02-15"
#define RUBY_VERSION_CODE 166
-#define RUBY_RELEASE_CODE 20020214
+#define RUBY_RELEASE_CODE 20020215