Commit 3ce293fa authored by Lucian Grijincu's avatar Lucian Grijincu Committed by Facebook Github Bot 3

folly: ubsan: elias-fano avoid memset(nullptr)

Reviewed By: ot

Differential Revision: D3300437

fbshipit-source-id: 7e0add5dab6dc1c891b742b4bcedea656c8284a9
parent 5fc9d571
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#pragma once #pragma once
#include <algorithm>
#include <cstdlib> #include <cstdlib>
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
...@@ -140,7 +141,7 @@ struct EliasFanoEncoderV2 { ...@@ -140,7 +141,7 @@ struct EliasFanoEncoderV2 {
forwardPointers_(reinterpret_cast<SkipValueType*>( forwardPointers_(reinterpret_cast<SkipValueType*>(
result.forwardPointers)), result.forwardPointers)),
result_(result) { result_(result) {
memset(result.data.data(), 0, result.data.size()); std::fill(result.data.begin(), result.data.end(), 0);
} }
EliasFanoEncoderV2(size_t size, ValueType upperBound) EliasFanoEncoderV2(size_t size, ValueType upperBound)
......
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