Merge "Fix reading uninitialized memory in BloomFilter."

This commit is contained in:
Keisuke Kuroyanagi 2014-02-14 03:58:13 +00:00 committed by Android (Google) Code Review
commit a2c8e166e9

View file

@ -17,6 +17,7 @@
#ifndef LATINIME_BLOOM_FILTER_H #ifndef LATINIME_BLOOM_FILTER_H
#define LATINIME_BLOOM_FILTER_H #define LATINIME_BLOOM_FILTER_H
#include <cstring>
#include <stdint.h> #include <stdint.h>
#include "defines.h" #include "defines.h"
@ -35,6 +36,7 @@ class BloomFilter {
public: public:
BloomFilter() { BloomFilter() {
ASSERT(BIGRAM_FILTER_BYTE_SIZE * 8 >= BIGRAM_FILTER_MODULO); ASSERT(BIGRAM_FILTER_BYTE_SIZE * 8 >= BIGRAM_FILTER_MODULO);
memset(mFilter, 0, sizeof(mFilter));
} }
// TODO: uint32_t position // TODO: uint32_t position