summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 40dd037da7..e2321c3394 100644
--- a/gc.c
+++ b/gc.c
@@ -31,6 +31,16 @@
#include <sys/types.h>
#include <assert.h>
+#if /* is ASAN enabled? */ defined(__has_feature) ? \
+ __has_feature(address_sanitizer) /* Clang */ : \
+ defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x */
+ #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
+ __attribute__((no_address_safety_analysis)) \
+ __attribute__((noinline))
+#else
+ #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+#endif
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -2685,6 +2695,7 @@ ruby_stack_check(void)
#endif
}
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
static void
mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n)
{