diff options
author | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2019-04-23 18:36:20 +0900 |
---|---|---|
committer | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2019-04-26 15:59:40 +0900 |
commit | 572f2ddff64ddf12f2331ad77b72d2b0c9d9883c (patch) | |
tree | e1b1928e5c54aa6074546bb2f41aa927bac5a18b /internal.h | |
parent | fa09acafde3b7dbb23edadc6eddcce27f7395880 (diff) |
use __attribute__((__no_sanitize__("memory")))
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/internal.h b/internal.h index b43ed312b0..f782668bd9 100644 --- a/internal.h +++ b/internal.h @@ -44,7 +44,18 @@ extern "C" { # define WARN_UNUSED_RESULT(x) x #endif +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +#ifndef __has_extension +# define __has_extension __has_feature +#endif + #if 0 +#elif defined(NO_SANITIZE) && __has_feature(memory_sanitizer) +# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ + NO_SANITIZE("memory", NO_SANITIZE("address", NOINLINE(x))) #elif defined(NO_SANITIZE) # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ NO_SANITIZE("address", NOINLINE(x)) @@ -87,14 +98,6 @@ extern "C" { #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#ifndef __has_feature -# define __has_feature(x) 0 -#endif - -#ifndef __has_extension -# define __has_extension __has_feature -#endif - #ifndef MJIT_HEADER #ifdef HAVE_SANITIZER_ASAN_INTERFACE_H |