diff options
author | MyoungJune Park <mj2004.park@samsung.com> | 2016-09-08 21:27:59 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2016-09-08 21:27:59 -0700 |
commit | bfc387e646ed0af3acbb60f08569ce7c80369bed (patch) | |
tree | 12ec3834bcff7387906ef103b292cc3ee910df96 | |
parent | d953cf2bf34b41560a75dd01ffc109de2690b31f (diff) | |
parent | a50feea6efd5a7c30492d06d72e1699a1b91737e (diff) | |
download | python-bfc387e646ed0af3acbb60f08569ce7c80369bed.tar.gz python-bfc387e646ed0af3acbb60f08569ce7c80369bed.tar.bz2 python-bfc387e646ed0af3acbb60f08569ce7c80369bed.zip |
Merge "Support address sanity checking in clang/GCC" into tizen_basesubmit/tizen_base/20160909.042824submit/tizen_3.0_base/20161028.062326submit/tizen_3.0.m2_base/20170104.073748accepted/tizen/base/20160923.170200accepted/tizen/3.0/base/20161028.103445accepted/tizen/3.0.m2/base/20170104.082008tizen_3.0_basetizen_3.0.m2_baseaccepted/tizen_3.0_baseaccepted/tizen_3.0.m2_base
-rw-r--r-- | Objects/obmalloc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 1434206..194fbfd 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1,5 +1,23 @@ #include "Python.h" +#if defined(__has_feature) /* Clang */ + #if __has_feature(address_sanitizer) /* is ASAN enabled? */ + #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \ + __attribute__ ((no_sanitize_address)) \ + __attribute__ ((noinline)) + #else + #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS + #endif +#else + #if defined(__SANITIZE_ADDRESS__) /* GCC, is ASAN enabled? */ + #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \ + __attribute__ ((no_sanitize_address)) \ + __attribute__ ((noinline)) + #else + #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS + #endif +#endif + #ifdef WITH_PYMALLOC #ifdef HAVE_MMAP @@ -971,6 +989,7 @@ redirect: /* free */ #undef PyObject_Free +ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS void PyObject_Free(void *p) { @@ -1201,6 +1220,7 @@ redirect: */ #undef PyObject_Realloc +ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS void * PyObject_Realloc(void *p, size_t nbytes) { |