Open
Description
Both the C and the java binary search implementations are subject to a classic integer overflow bug in binary search; e.g. at
https://github.com/RoaringBitmap/CRoaring/blob/master/include/roaring/containers/run.h#L91
instead of
int32_t middleIndex = (low + high) >> 1;
prefer:
int32_t middleIndex = low + ((high-low) >> 1);