[libcxx-commits] [libcxx] [libc++] Add assumption for align of begin and end pointers of vector. (PR #108961)

Hans Wennborg via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 29 11:32:55 PST 2025


================
@@ -775,6 +780,17 @@ class _LIBCPP_TEMPLATE_VIS vector {
   }
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(vector&, false_type) _NOEXCEPT {}
+
+  static _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __add_alignment_assumption(pointer __p) _NOEXCEPT {
----------------
zmodem wrote:

I haven't tried to reproduce it on the libc++ tests directly, but it should be possible. I think we're currently only using a subset of the cfi checks: `-fsanitize=cfi-vcall -fsanitize=cfi-derived-cast -fsanitize=cfi-unrelated-cast`. The annoying thing is that cfi requires (thin) lto.

https://github.com/llvm/llvm-project/pull/108961


More information about the libcxx-commits mailing list