Skip to content

Commit

Permalink
Fix BloomFilterPolicy changes for unsigned char (ARM) (#6024)
Browse files Browse the repository at this point in the history
Summary:
Bug in PR #5941 when char is unsigned that should only affect
assertion on unused/invalid filter metadata.
Pull Request resolved: #6024

Test Plan: on ARM: ./bloom_test && ./db_bloom_filter_test && ./block_based_filter_block_test && ./full_filter_block_test && ./partitioned_filter_block_test

Differential Revision: D18461206

Pulled By: pdillinger

fbshipit-source-id: 68a7c813a0b5791c05265edc03cdf52c78880e9a
  • Loading branch information
pdillinger authored and facebook-github-bot committed Nov 12, 2019
1 parent 6c7b1a0 commit 42b5494
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion table/block_based/filter_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ FilterBitsReader* BloomFilterPolicy::GetFilterBitsReader(
return new AlwaysFalseFilter();
}

char raw_num_probes = contents.data()[len_with_meta - 5];
int8_t raw_num_probes =
static_cast<int8_t>(contents.data()[len_with_meta - 5]);
// NB: *num_probes > 30 and < 128 probably have not been used, because of
// BloomFilterPolicy::initialize, unless directly calling
// FullFilterBitsBuilder as an API, but we are leaving those cases in
Expand Down

0 comments on commit 42b5494

Please sign in to comment.