summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm.c b/vm.c
index ea9e2a5b62..673026214d 100644
--- a/vm.c
+++ b/vm.c
@@ -1616,14 +1616,15 @@ rb_thread_mark(void *ptr)
th = ptr;
if (th->stack) {
VALUE *p = th->stack;
- VALUE *sp = th->cfp->sp + th->mark_stack_len;
+ VALUE *sp = th->cfp->sp;
rb_control_frame_t *cfp = th->cfp;
- rb_control_frame_t *limit_cfp =
- (void *)(th->stack + th->stack_size);
+ rb_control_frame_t *limit_cfp = (void *)(th->stack + th->stack_size);
while (p < sp) {
rb_gc_mark(*p++);
}
+ rb_gc_mark_locations(p, p + th->mark_stack_len);
+
while (cfp != limit_cfp) {
rb_gc_mark(cfp->proc);
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);