summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-10-01 18:13:26 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2020-10-01 18:14:43 -0700
commit4b41ee154f117e18b54c7fb31574f2e314f10f15 (patch)
treee942c648b928b385cf8c01bcafa69702de80a801 /vm.c
parent8d76b729a180c47d8edf4392d84a02ec00aeb37b (diff)
Update the thread's self / wrapper address
Threads can move, and if they do, their self pointer may go bad. We need to update it.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 1b8b5483aa..9535205fb2 100644
--- a/vm.c
+++ b/vm.c
@@ -2660,6 +2660,8 @@ thread_compact(void *ptr)
{
rb_thread_t *th = ptr;
+ th->self = rb_gc_location(th->self);
+
if (!th->root_fiber) {
rb_execution_context_update(th->ec);
}