summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-23 06:40:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-23 06:40:26 -0700
commiteabf60be86513df75a08df8388099179c827b475 (patch)
tree700c4ca84484e3952d0d339c5f264c3dc4e22dfc
parentad4e4e79ac6b9fcb182f3cd834120ec79512ac9a (diff)
downloadtxr-eabf60be86513df75a08df8388099179c827b475.tar.gz
txr-eabf60be86513df75a08df8388099179c827b475.tar.bz2
txr-eabf60be86513df75a08df8388099179c827b475.zip
cyr: broken on 64 bit.
* lib.c (cyr): We must use the cnum type for the mask, not int.
-rw-r--r--lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 75cb56d4..7c5b671a 100644
--- a/lib.c
+++ b/lib.c
@@ -1510,9 +1510,10 @@ val cyr(val addr, val obj)
{
cnum a = c_num(addr, self);
if (a > 0) {
- int m, h = highest_bit(a);
+ int h = highest_bit(a);
+ cnum m;
if (h > 1) {
- for (m = 1 << (h - 2); m != 0; m >>= 1)
+ for (m = convert(cnum, 1) << (h - 2); m != 0; m >>= 1)
obj = if3((a & m) != 0, car(obj), cdr(obj));
}
return obj;