summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kazmin <a.kazmin@partner.samsung.com>2021-03-31 15:37:23 +0300
committerAndrey Kazmin <a.kazmin@partner.samsung.com>2021-09-10 14:32:12 +0300
commit5c8b3c76e72f1843812aa93f7c9613841878b836 (patch)
treee0e93750e470a3753fcf13481a5a212986145962
parent4812e104b473a5f3b766bae53347df3185b1e90c (diff)
downloadpython-5c8b3c76e72f1843812aa93f7c9613841878b836.tar.gz
python-5c8b3c76e72f1843812aa93f7c9613841878b836.tar.bz2
python-5c8b3c76e72f1843812aa93f7c9613841878b836.zip
Change-Id: I52dc2e8c405064463d84201ee3fb8f5291d47c9b Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
-rw-r--r--Objects/obmalloc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 2067cf5..99b577a 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -8,6 +8,12 @@
#else
#define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
#endif
+ #if __has_feature(hwaddress_sanitizer) /* is HWASAN enabled? */
+ #define ATTRIBUTE_NO_SANITIZE_HWADDRESS \
+ __attribute__((no_sanitize("hwaddress")))
+ #else
+ #define ATTRIBUTE_NO_SANITIZE_HWADDRESS
+ #endif
#else
#if defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x, is ASAN enabled? */
#define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
@@ -16,6 +22,12 @@
#else
#define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
#endif
+ #if defined(__SANITIZE_HWADDRESS__) /* is HWASAN enabled? */
+ #define ATTRIBUTE_NO_SANITIZE_HWADDRESS \
+ __attribute__((no_sanitize_hwaddress))
+ #else
+ #define ATTRIBUTE_NO_SANITIZE_HWADDRESS
+ #endif
#endif
#ifdef WITH_PYMALLOC
@@ -996,6 +1008,7 @@ redirect:
#undef PyObject_Free
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+ATTRIBUTE_NO_SANITIZE_HWADDRESS
void
PyObject_Free(void *p)
{
@@ -1227,6 +1240,7 @@ redirect:
#undef PyObject_Realloc
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+ATTRIBUTE_NO_SANITIZE_HWADDRESS
void *
PyObject_Realloc(void *p, size_t nbytes)
{