aboutsummaryrefslogtreecommitdiff
path: root/py/gc.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-06-18 14:15:37 +1000
committerDamien George <damien@micropython.org>2021-06-18 14:15:37 +1000
commitbc89cdeb45b66961b56e2354f2a0be9ef611ad7b (patch)
tree46934f0c498dd7049d80a9fb263e519fd2e48ea5 /py/gc.c
parenteb7ae538f91b5041c92887290756c9526bf38df8 (diff)
py/gc: Only use no_sanitize_address attribute for GCC 4.8 and above.
It's not supported on older GCC versions. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/gc.c')
-rw-r--r--py/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/gc.c b/py/gc.c
index 56111bd3b..8284c435b 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -345,7 +345,7 @@ void gc_collect_start(void) {
// Address sanitizer needs to know that the access to ptrs[i] must always be
// considered OK, even if it's a load from an address that would normally be
// prohibited (due to being undefined, in a red zone, etc).
-#ifdef __GNUC__
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
__attribute__((no_sanitize_address))
#endif
static void *gc_get_ptr(void **ptrs, int i) {