[PATCH] D40743: Make rehash(0) work with ubsan's unsigned-integer-overflow.

2018-01-08 Thread Dan Albert via Phabricator via cfe-commits
danalbert added inline comments. Comment at: include/__hash_table:2141 __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n); mclow.lists wrote: > danalbert wrote: > > With `rehash(0)` this is `0 & (0 - 1)`, which triggers > > unsigne

[PATCH] D40743: Make rehash(0) work with ubsan's unsigned-integer-overflow.

2018-01-08 Thread Dan Albert via Phabricator via cfe-commits
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

[PATCH] D40743: Make rehash(0) work with ubsan's unsigned-integer-overflow.

2017-12-14 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists accepted this revision. mclow.lists added inline comments. This revision is now accepted and ready to land. Comment at: include/__hash_table:2141 __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n); danalbert wrote: > Wit

[PATCH] D40743: Make rehash(0) work with ubsan's unsigned-integer-overflow.

2017-12-11 Thread Dan Albert via Phabricator via cfe-commits
danalbert added inline comments. Comment at: include/__hash_table:2141 __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n); With `rehash(0)` this is `0 & (0 - 1)`, which triggers unsigned-integer-overflow. Repository: rCXX libc+

[PATCH] D40743: Make rehash(0) work with ubsan's unsigned-integer-overflow.

2017-12-11 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. Dan - I think I need a bit more context here. How does UBSan get triggered? Repository: rCXX libc++ https://reviews.llvm.org/D40743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

[PATCH] D40743: Make rehash(0) work with ubsan's unsigned-integer-overflow.

2017-12-01 Thread Dan Albert via Phabricator via cfe-commits
danalbert created this revision. 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