diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2014-07-28 15:02:42 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2014-07-28 15:02:42 +0000 |
commit | 51510e7f4c38972b4eef7f5b943aac6d9044cb68 (patch) | |
tree | b1d682c9f259bbbc8da416cde4785bdd09cb3a7b /libcxx/include/vector | |
parent | 2172f51e4ec83d7e7290f35d63fc4304f9cf0087 (diff) | |
download | bcm5719-llvm-51510e7f4c38972b4eef7f5b943aac6d9044cb68.tar.gz bcm5719-llvm-51510e7f4c38972b4eef7f5b943aac6d9044cb68.zip |
Fix PR#20471. Add a cast in __align_it to ensure that the bit twiddling is done at the correct size. A better solution, IMHO, would be to declare vector<bool>::__bits_per_word as 'size_type', rather than 'unsigned', but that's a possible ABI change.
llvm-svn: 214088
Diffstat (limited to 'libcxx/include/vector')
-rw-r--r-- | libcxx/include/vector | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/vector b/libcxx/include/vector index 1e638b9a4d9..5d41bd11081 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -2352,7 +2352,7 @@ private: void deallocate() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static size_type __align_it(size_type __new_size) _NOEXCEPT - {return __new_size + (__bits_per_word-1) & ~(__bits_per_word-1);}; + {return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);}; _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const; _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x); template <class _ForwardIterator> |