Skip to content

Commit 3d88874

Browse files
committed
[libcxx] Add assert into __set_long_cap
1 parent cf5a8b4 commit 3d88874

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libcxx/include/string

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,7 @@ private:
18761876
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_cap(size_type __s) _NOEXCEPT {
18771877
__r_.first().__l.__cap_ = __s / __endian_factor;
18781878
__r_.first().__l.__is_long_ = true;
1879+
_LIBCPP_ASSERT_INTERNAL(__s == __get_long_cap(), "Size must be __endian_factor aligned.");
18791880
}
18801881

18811882
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_long_cap() const _NOEXCEPT {

0 commit comments

Comments
 (0)