From 16f5b18b7aa505765a5361a7d828e33963ea61bc Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 6 Nov 2018 02:57:28 +0000 Subject: gc.c: move ASAN check to configure Availability of attributes are checked in configure these days, rather than compiler macros. Also __attribute__((no_address_safety_analysis)) is considered deprecated in both GCC and Clang. Use the current best practice if available. See also: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html https://clang.llvm.org/docs/AddressSanitizer.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 0c61cb4c82..e02935d66f 100644 --- a/gc.c +++ b/gc.c @@ -61,16 +61,6 @@ # endif #endif -#if /* is ASAN enabled? */ \ - __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 #endif @@ -4158,8 +4148,10 @@ ruby_stack_check(void) } ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS +( static void mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n) +) { VALUE v; while (n--) { -- cgit v1.2.3