From 1553f4e70eaa18b5989dc888a89d7c9b03f2232c Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Sun, 23 Dec 2018 13:37:23 +0100 Subject: [PATCH] ecl_equal: fix comparison of displaced bitvectors (this time for real) The "fix" from commit d3420eb3d5f13825e0933fc7c0b2a424c7ed7fa7 did not work properly for bitvectors with length > 8. Fixes #445 --- src/c/predicate.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c/predicate.d b/src/c/predicate.d index 3afe10edd..c460e96f6 100644 --- a/src/c/predicate.d +++ b/src/c/predicate.d @@ -378,8 +378,8 @@ ecl_equal(register cl_object x, cl_object y) ox = x->vector.offset; oy = y->vector.offset; for (i = 0; i < x->vector.fillp; i++) - if(((x->vector.self.bit[(i+ox)/8] & (0200>>(i+ox)%8)) << ox) - !=((y->vector.self.bit[(i+oy)/8] & (0200>>(i+oy)%8)) << oy)) + if(((x->vector.self.bit[(i+ox)/8] << (i+ox)%8) & 0200) + != ((y->vector.self.bit[(i+oy)/8] << (i+oy)%8) & 0200)) return(FALSE); return(TRUE); }