]> gitweb.factorcode.org Git - factor.git/commitdiff
fix broken fixnum bitops
authorSlava Pestov <slava@factorcode.org>
Fri, 27 Aug 2004 06:35:26 +0000 (06:35 +0000)
committerSlava Pestov <slava@factorcode.org>
Fri, 27 Aug 2004 06:35:26 +0000 (06:35 +0000)
library/test/math/bitops.factor
native/fixnum.c

index 4e09e60e5f3c0e104137f0d08999c734f6020d02..5f6faa82d44fd83d7265abc3bc9484fa43149658 100644 (file)
@@ -19,3 +19,4 @@ USE: test
 [ -1 ] [ 123 >bignum dup bitnot bitxor ] unit-test
 [ -1 ] [ 123 dup bitnot >bignum bitxor ] unit-test
 [ -1 ] [ 123 dup bitnot bitxor >bignum ] unit-test
+[ 4 ] [ 4 7 bitand ] unit-test
index 2be68bd2aa3c7d0412c1f487486276d8774b636a..10694fc70bd31c4cb132db7a993a9acac4913c55 100644 (file)
@@ -136,17 +136,17 @@ CELL divide_fixnum(FIXNUM x, FIXNUM y)
 
 CELL and_fixnum(FIXNUM x, FIXNUM y)
 {
-       return x & y;
+       return tag_fixnum(x & y);
 }
 
 CELL or_fixnum(FIXNUM x, FIXNUM y)
 {
-       return x | y;
+       return tag_fixnum(x | y);
 }
 
 CELL xor_fixnum(FIXNUM x, FIXNUM y)
 {
-       return x ^ y;
+       return tag_fixnum(x ^ y);
 }
 
 CELL shift_fixnum(FIXNUM x, FIXNUM y)