Skip to content

Commit 4bf37d8

Browse files
ezbrcopybara-github
authored andcommitted
Fix a bug of casting sizeof(slot_type) to uint16_t instead of uint32_t.
Note that in the above static_assert, we check that sizeof(slot_type) fits in a uint32_t, not a uint16_t and the field in PolicyFunctions is a uint32_t. PiperOrigin-RevId: 756886567 Change-Id: I5ca915b814d1da6cdc1d24152b2ebde5dec9d28b
1 parent 83e249f commit 4bf37d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

absl/container/internal/raw_hash_set.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3607,7 +3607,7 @@ class raw_hash_set {
36073607
static constexpr PolicyFunctions value = {
36083608
static_cast<uint32_t>(sizeof(key_type)),
36093609
static_cast<uint32_t>(sizeof(value_type)),
3610-
static_cast<uint16_t>(sizeof(slot_type)),
3610+
static_cast<uint32_t>(sizeof(slot_type)),
36113611
static_cast<uint16_t>(alignof(slot_type)), SooEnabled(),
36123612
ShouldSampleHashtablezInfoForAlloc<CharAlloc>(),
36133613
// TODO(b/328722020): try to type erase

0 commit comments

Comments
 (0)