summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/vm.c b/vm.c
index 16524181be..10c9abc5b0 100644
--- a/vm.c
+++ b/vm.c
@@ -2368,6 +2368,7 @@ rb_thread_mark(void *ptr)
rb_thread_t *th = ptr;
RUBY_MARK_ENTER("thread");
+ /* mark VM stack */
if (th->ec.stack) {
VALUE *p = th->ec.stack;
VALUE *sp = th->ec.cfp->sp;
@@ -2389,6 +2390,14 @@ rb_thread_mark(void *ptr)
}
}
+ /* mark machine stack */
+ if (GET_THREAD() != th && th->machine.stack_start && th->machine.stack_end) {
+ rb_gc_mark_machine_stack(th);
+ rb_gc_mark_locations((VALUE *)&th->machine.regs,
+ (VALUE *)(&th->machine.regs) +
+ sizeof(th->machine.regs) / sizeof(VALUE));
+ }
+
/* mark ruby objects */
RUBY_MARK_UNLESS_NULL(th->first_proc);
if (th->first_proc) RUBY_MARK_UNLESS_NULL(th->first_args);
@@ -2412,13 +2421,6 @@ rb_thread_mark(void *ptr)
RUBY_MARK_UNLESS_NULL(th->local_storage_recursive_hash);
RUBY_MARK_UNLESS_NULL(th->local_storage_recursive_hash_for_trace);
- if (GET_THREAD() != th && th->machine.stack_start && th->machine.stack_end) {
- rb_gc_mark_machine_stack(th);
- rb_gc_mark_locations((VALUE *)&th->machine.regs,
- (VALUE *)(&th->machine.regs) +
- sizeof(th->machine.regs) / sizeof(VALUE));
- }
-
RUBY_MARK_UNLESS_NULL(th->name);
rb_vm_trace_mark_event_hooks(&th->event_hooks);