diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -20,9 +20,14 @@ #undef RUBY_EXPORT #include "ruby.h" #include "vm_debug.h" +#include "internal/sanitizers.h" #ifdef HAVE_LOCALE_H #include <locale.h> #endif +#if USE_SHARED_GC +#include "internal/gc.h" +#endif + #if defined RUBY_DEVEL && !defined RUBY_DEBUG_ENV # define RUBY_DEBUG_ENV 1 #endif @@ -46,7 +51,7 @@ int rb_wasm_rt_start(int (main)(int argc, char **argv), int argc, char **argv); int main(int argc, char **argv) { -#ifdef RUBY_DEBUG_ENV +#if defined(RUBY_DEBUG_ENV) || USE_RUBY_DEBUG_LOG ruby_set_debug_option(getenv("RUBY_DEBUG")); #endif #ifdef HAVE_LOCALE_H @@ -56,3 +61,14 @@ main(int argc, char **argv) ruby_sysinit(&argc, &argv); return rb_main(argc, argv); } + +#ifdef RUBY_ASAN_ENABLED +/* Compile in the ASAN options Ruby needs, rather than relying on environment variables, so + * that even tests which fork ruby with a clean environment will run ASAN with the right + * settings */ +const char * +__asan_default_options(void) +{ + return "use_sigaltstack=0:detect_leaks=0"; +} +#endif |