diff options
| author | Dan Albert <danalbert@google.com> | 2018-01-08 22:57:12 +0000 |
|---|---|---|
| committer | Dan Albert <danalbert@google.com> | 2018-01-08 22:57:12 +0000 |
| commit | 553b09b515cc18394d7df5e926fdf80743d62851 (patch) | |
| tree | a0befd539d86f72fc9d16f39338987f147118e03 /libcxx/include | |
| parent | de91dff5d403387a8f0dafbe8dbbb18ecd416570 (diff) | |
| download | bcm5719-llvm-553b09b515cc18394d7df5e926fdf80743d62851.tar.gz bcm5719-llvm-553b09b515cc18394d7df5e926fdf80743d62851.zip | |
Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."
Seems to have broken some tests since I first wrote this a while
back. Will reland after checking what went wrong with the tests.
This reverts commit 7023194c8d11a081fd01ed25308b3d60193c6a06.
llvm-svn: 322039
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/__hash_table | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index 239415231f6..3f430af1283 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -2136,7 +2136,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc> void __hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n) { - if (__n < 2) + if (__n == 1) __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n); |

