File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 211211// out of bounds or does other scary things with memory.
212212// NOTE: GCC supports AddressSanitizer(asan) since 4.8.
213213// https://gcc.gnu.org/gcc-4.8/changes.html
214- #if ABSL_HAVE_ATTRIBUTE(no_sanitize_address)
214+ #if defined(ABSL_HAVE_ADDRESS_SANITIZER) && \
215+ ABSL_HAVE_ATTRIBUTE (no_sanitize_address)
215216#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__ ((no_sanitize_address))
216- #elif defined(_MSC_VER) && _MSC_VER >= 1928
217+ #elif defined(ABSL_HAVE_ADDRESS_SANITIZER) && defined(_MSC_VER) && \
218+ _MSC_VER >= 1928
217219// https://docs.microsoft.com/en-us/cpp/cpp/no-sanitize-address
218220#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS __declspec (no_sanitize_address)
221+ #elif defined(ABSL_HAVE_HWADDRESS_SANITIZER) && ABSL_HAVE_ATTRIBUTE(no_sanitize)
222+ // HWAddressSanitizer is a sanitizer similar to AddressSanitizer, which uses CPU
223+ // features to detect similar bugs with less CPU and memory overhead.
224+ // NOTE: GCC supports HWAddressSanitizer(hwasan) since 11.
225+ // https://gcc.gnu.org/gcc-11/changes.html
226+ #define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS \
227+ __attribute__ ((no_sanitize(" hwaddress" )))
219228#else
220229#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS
221230#endif
You can’t perform that action at this time.
0 commit comments