summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2023-11-12 16:19:31 +1100
committerKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-01-12 17:29:48 +1100
commitd10bc3a2b8300cffc383e10c3730871e851be24c (patch)
treec1c8e09a280ab3d8db0ee941aa8c88ae8592785e /thread.c
parentbdafad879093ef16a9a649154c4b2e4ebf492656 (diff)
Mark asan fake stacks during machine stack marking
ASAN leaves a pointer to the fake frame on the stack; we can use the __asan_addr_is_in_fake_stack API to work out the extent of the fake stack and thus mark any VALUEs contained therein. [Bug #20001]
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index e7a9d7cd9b..27a6ffb955 100644
--- a/thread.c
+++ b/thread.c
@@ -525,6 +525,9 @@ void
ruby_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
{
native_thread_init_stack(th, local_in_parent_frame);
+#ifdef RUBY_ASAN_ENABLED
+ th->asan_fake_stack_handle = asan_get_thread_fake_stack_handle();
+#endif
}
const VALUE *