Index: libcxx/include/__hash_table =================================================================== --- libcxx/include/__hash_table +++ libcxx/include/__hash_table @@ -1809,10 +1809,12 @@ if (__ndptr != nullptr) { for (__ndptr = __ndptr->__next_; __ndptr != nullptr && - std::__constrain_hash(__ndptr->__hash(), __bc) == __chash; + (__ndptr->__hash() == __hash || + std::__constrain_hash(__ndptr->__hash(), __bc) == __chash); __ndptr = __ndptr->__next_) { - if (key_eq()(__ndptr->__upcast()->__value_, __value)) + if ((__ndptr->__hash() == __hash) && + key_eq()(__ndptr->__upcast()->__value_, __value)) return __ndptr; } } @@ -2024,7 +2026,8 @@ (__nd->__hash() == __hash || std::__constrain_hash(__nd->__hash(), __bc) == __chash); __nd = __nd->__next_) { - if (key_eq()(__nd->__upcast()->__value_, __k)) + if ((__nd->__hash() == __hash) && + key_eq()(__nd->__upcast()->__value_, __k)) goto __done; } }