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
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
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
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+
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
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