Commit abb963a0 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 4

Force the overflow in BitVectorCoding::skipTo to be 64-bit

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
parent 6e8fcd16
...@@ -346,8 +346,8 @@ class BitVectorReader { ...@@ -346,8 +346,8 @@ class BitVectorReader {
if (Encoder::skipQuantum > 0 && v - value_ > Encoder::skipQuantum) { if (Encoder::skipQuantum > 0 && v - value_ > Encoder::skipQuantum) {
size_t q = v / Encoder::skipQuantum; size_t q = v / Encoder::skipQuantum;
position_ = folly::loadUnaligned<SkipValueType>( position_ = size_t(folly::loadUnaligned<SkipValueType>(
skipPointers_ + (q - 1) * sizeof(SkipValueType)) - 1; skipPointers_ + (q - 1) * sizeof(SkipValueType))) - 1;
reposition(q * Encoder::skipQuantum); reposition(q * Encoder::skipQuantum);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment