You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang] Add flag to disable container overflow checks at compile time.
Add a compiler flag to allow library developers to support disabling
AddressSanitizer's container overflow detection in template code at
compile time.
The primary motivation is to reduce false positives in environments where
libraries and frameworks that cannot be recompiled with sanitizers enabled
are called from application code. This supports disabling checks when the
runtime environment cannot be reliably controlled to use ASAN_OPTIONS.
Key changes:
- Add -fsanitize-address-disable-container-overflow driver flag
- Add __has_feature(sanitize_address_disable_container_overflow) feature test
- Connect flag through LangOptions and CodeGenOptions
- Update compiler-rt test to conditionally use container annotations
- Add comprehensive test coverage for driver flag and feature macro
- Update documentation in AddressSanitizer.rst and UsersManual.rst
The recommended usage pattern is:
This provides backward compatibility with compilers that don't support
the new feature test macro.
The flag is marked experimental.
0 commit comments