68-asan-contiguous-container.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. diff --git a/include/__config b/include/__config
  2. index 1bb99ee..465d784 100644
  3. --- a/include/__config
  4. +++ b/include/__config
  5. @@ -1081,10 +1081,12 @@ typedef __char32_t char32_t;
  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 !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  10. extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container(
  11. const void*, const void*, const void*, const void*, const void*, const void*);
  12. extern "C" _LIBCPP_EXPORTED_FROM_ABI int
  13. __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);
  14. +# endif
  15. # endif
  16. // Try to find out if RTTI is disabled.
  17. diff --git a/include/deque b/include/deque
  18. index 154926d..9559235 100644
  19. --- a/include/deque
  20. +++ b/include/deque
  21. @@ -886,7 +886,7 @@ private:
  22. (void)__old_con_end;
  23. (void)__new_con_beg;
  24. (void)__new_con_end;
  25. -#ifndef _LIBCPP_HAS_NO_ASAN
  26. +#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  27. if (__beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value)
  28. __sanitizer_annotate_double_ended_contiguous_container(
  29. __beg, __end, __old_con_beg, __old_con_end, __new_con_beg, __new_con_end);
  30. @@ -1077,7 +1077,7 @@ private:
  31. }
  32. #endif
  33. }
  34. -#if !defined(_LIBCPP_HAS_NO_ASAN)
  35. +#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  36. public:
  37. _LIBCPP_HIDE_FROM_ABI bool __verify_asan_annotations() const _NOEXCEPT {
  38. diff --git a/include/vector b/include/vector
  39. index b989a3c..61e3263 100644
  40. --- a/include/vector
  41. +++ b/include/vector
  42. @@ -848,7 +848,7 @@ private:
  43. __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {
  44. (void)__old_mid;
  45. (void)__new_mid;
  46. -#ifndef _LIBCPP_HAS_NO_ASAN
  47. +#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
  48. const void* __beg = data();
  49. const void* __end = data() + capacity();
  50. if (!__libcpp_is_constant_evaluated() && __beg != nullptr &&