Summary: This code was relying on the `- 1` overflowing as a 64-bit value, but MSVC (correctly in my opinion) was overflowing this as a 32-bit value, resulting in a segfault when trying to run the bitvector and eliasfano tests on MSVC.
Reviewed By: yfeldblum
Differential Revision:
D3652343
fbshipit-source-id:
38a22abfc0d05ab2f070c450eebfa69af07d26af
if (Encoder::skipQuantum > 0 && v - value_ > Encoder::skipQuantum) {
size_t q = v / Encoder::skipQuantum;
- position_ = folly::loadUnaligned<SkipValueType>(
- skipPointers_ + (q - 1) * sizeof(SkipValueType)) - 1;
+ position_ = size_t(folly::loadUnaligned<SkipValueType>(
+ skipPointers_ + (q - 1) * sizeof(SkipValueType))) - 1;
reposition(q * Encoder::skipQuantum);
}