This revision was automatically updated to reflect the committed changes. Closed by commit rCXX322031: Make rehash(0) work with ubsan's unsigned-integer-overflow. (authored by danalbert, committed by ).
Changed prior to commit: https://reviews.llvm.org/D40743?vs=125193&id=128979#toc Repository: rCXX libc++ https://reviews.llvm.org/D40743 Files: include/__hash_table Index: include/__hash_table =================================================================== --- include/__hash_table +++ include/__hash_table @@ -2136,7 +2136,7 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n) { - if (__n == 1) + if (__n < 2) __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n);
Index: include/__hash_table =================================================================== --- include/__hash_table +++ include/__hash_table @@ -2136,7 +2136,7 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n) { - if (__n == 1) + if (__n < 2) __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits