From 2bf5be1db569ed4f7d4633fe7d56e585ae6adf52 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 26 Sep 2013 05:46:52 +0000 Subject: gc.c: disable AddressSanitizer * gc.c (mark_locations_array): disable AddressSanitizer. based on a patch by halfie (Ruby Guy) at [ruby-core:57372]. [ruby-core:56155] [Bug #8680] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ gc.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 272c4a331b..6a38aa954a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Sep 26 14:46:49 2013 Nobuyoshi Nakada + + * gc.c (mark_locations_array): disable AddressSanitizer. based on a + patch by halfie (Ruby Guy) at [ruby-core:57372]. + [ruby-core:56155] [Bug #8680] + Wed Sep 25 17:41:29 2013 Koichi Sasada * README.EXT, README.EXT.ja: remove description of RARRAY_PTR() diff --git a/gc.c b/gc.c index 40dd037da7..e2321c3394 100644 --- a/gc.c +++ b/gc.c @@ -31,6 +31,16 @@ #include #include +#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 #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) { -- cgit v1.2.3