68-asan-contiguous-container.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. diff --git a/include/__config b/include/__config
  2. index 3b1c3a6..0b4f9ef 100644
  3. --- a/include/__config
  4. +++ b/include/__config
  5. @@ -1063,7 +1063,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
  6. # ifndef _LIBCPP_HAS_NO_ASAN
  7. extern "C" _LIBCPP_EXPORTED_FROM_ABI void
  8. __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
  9. -# if _LIBCPP_CLANG_VER >= 1600
  10. +# if _LIBCPP_CLANG_VER >= 1600 && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  11. extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container(
  12. const void*, const void*, const void*, const void*, const void*, const void*);
  13. extern "C" _LIBCPP_EXPORTED_FROM_ABI int
  14. diff --git a/include/deque b/include/deque
  15. index 951bab9..d4ffc7f 100644
  16. --- a/include/deque
  17. +++ b/include/deque
  18. @@ -968,7 +968,7 @@ public:
  19. // __asan_annotate_container_with_allocator to false.
  20. // For more details, see the "Using libc++" documentation page or
  21. // the documentation for __sanitizer_annotate_contiguous_container.
  22. -#if !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600
  23. +#if !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600 && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  24. // TODO LLVM18: Remove the special-casing
  25. _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
  26. const void* __beg,
  27. diff --git a/include/vector b/include/vector
  28. index 659b035..3153e89 100644
  29. --- a/include/vector
  30. +++ b/include/vector
  31. @@ -861,7 +861,7 @@ private:
  32. // __asan_annotate_container_with_allocator to false.
  33. // For more details, see the "Using libc++" documentation page or
  34. // the documentation for __sanitizer_annotate_contiguous_container.
  35. -#ifndef _LIBCPP_HAS_NO_ASAN
  36. +#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  37. _LIBCPP_CONSTEXPR_SINCE_CXX20
  38. void __annotate_contiguous_container(const void *__beg, const void *__end,
  39. const void *__old_mid,