Commit d7f0e320 authored by Igor Sugak's avatar Igor Sugak Committed by Facebook Github Bot

fix implicit-integer-truncation UBSAN error in CompressionTest.cpp

Summary:
UndefinedBehaviorSanitizer: implicit-integer-truncation folly/compression/test/CompressionTest.cpp:111:34
```
Note, this is not an undefined behavior, but usually is unintentional. In this case it's intentional, add an explicit static_cast to the destination type.

Reviewed By: yfeldblum

Differential Revision: D19281230

fbshipit-source-id: 5374028e551b96e757fbb9f63af2cbbd8ee100e6
parent b84db9a9
......@@ -108,7 +108,7 @@ RandomDataHolder::RandomDataHolder(size_t sizeLog2) : DataHolder(sizeLog2) {
size_t countLog2 = sizeLog2 - numThreadsLog2;
size_t start = size_t(t) << countLog2;
for (size_t i = 0; i < countLog2; ++i) {
this->data_[start + i] = rng();
this->data_[start + i] = static_cast<uint8_t>(rng());
}
});
}
......
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