diff --git a/common.mk b/common.mk index 3e8626532a..c6d6e54c72 100644 --- a/common.mk +++ b/common.mk @@ -3367,6 +3367,7 @@ cont.$(OBJEXT): $(top_srcdir)/internal/cont.h cont.$(OBJEXT): $(top_srcdir)/internal/gc.h cont.$(OBJEXT): $(top_srcdir)/internal/imemo.h cont.$(OBJEXT): $(top_srcdir)/internal/proc.h +cont.$(OBJEXT): $(top_srcdir)/internal/sanitizers.h cont.$(OBJEXT): $(top_srcdir)/internal/serial.h cont.$(OBJEXT): $(top_srcdir)/internal/static_assert.h cont.$(OBJEXT): $(top_srcdir)/internal/vm.h diff --git a/cont.c b/cont.c index 8a9aded713..19e719ccd9 100644 --- a/cont.c +++ b/cont.c @@ -30,6 +30,7 @@ extern int madvise(caddr_t, size_t, int); #include "internal.h" #include "internal/cont.h" #include "internal/proc.h" +#include "internal/sanitizers.h" #include "internal/warnings.h" #include "ruby/fiber/scheduler.h" #include "mjit.h" @@ -1161,6 +1162,7 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont) } FLUSH_REGISTER_WINDOWS; + asan_unpoison_memory_region(cont->machine.stack_src, size, false); MEMCPY(cont->machine.stack, cont->machine.stack_src, VALUE, size); }