================
@@ -242,6 +255,43 @@ AddressSanitizer also supports
 works similar to ``__attribute__((no_sanitize("address")))``, but it also
 prevents instrumentation performed by other sanitizers.
 
+Disabling container overflow checks
+-----------------------------------
+
+Runtime suppression
+^^^^^^^^^^^^^^^^^^^
+
+Container overflow checks can be disabled at runtime using
+``ASAN_OPTIONS=detect_container_overflow=0``
+
+Compile time suppression
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+``-D__ASAN_DISABLE_CONTAINER_OVERFLOW__`` can be used at compile time to
+disable container overflow checks if the container library has added support
+for this define.
----------------
vitalybuka wrote:

> Is there anything stopping libcxx

That plan, we will use the header in libcxx.

The concerns are:

1. if some down stream users already forward declare the symbol e.g. 
https://github.com/marcov64/Lsd/blob/af565b26c806e678c475303567738735bcaceff9/gnu/include/c%2B%2B/13.2.0/bits/stl_vector.h#L74

2.  Older versions of libcxx, do we need them with a new compiler-rt?

So I see either to do Pure macro stuff, which is OK to me, and simple:
```
#ifdef __ASAN_DISABLE_CONTAINER_OVERFLOW__
#define SANITIZER_ANNOTATE_ANNOTATE_CONTIGUOUS_CONTAINER(...) { // no-op in 
whatever safe way}
#else
#define SANITIZER_ANNOTATE_ANNOTATE_CONTIGUOUS_CONTAINER(...) { \
__sanitizer_annotate_contiguous_container(...); \
} 
#endif
```

Or if we do "static" then we don't forward declare, just introduce a new symbol,
which either has an empty body, or calls to the existing one.


https://github.com/llvm/llvm-project/pull/163468
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to