Skip to content

Commit

Permalink
Initialize ctrl_ with its correct size (#653)
Browse files Browse the repository at this point in the history
This bug was caught by MSAN when the hashmap is serialized.
  • Loading branch information
rocallahan authored Jul 15, 2024
1 parent ebf35c2 commit 6534adf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parallel_hashmap/parallel_hashmap/phmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ class raw_hash_set

// Reset all ctrl bytes back to kEmpty, except the sentinel.
void reset_ctrl() {
std::memset(ctrl_, kEmpty, capacity_ + Group::kWidth);
std::memset(ctrl_, kEmpty, capacity_ + Group::kWidth + 1);
ctrl_[capacity_] = kSentinel;
SanitizerPoisonMemoryRegion(slots_, sizeof(slot_type) * capacity_);
}
Expand Down

0 comments on commit 6534adf

Please sign in to comment.