summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-12-17 09:27:11 -0500
committerPeter Zhu <[email protected]>2024-12-17 11:03:38 -0500
commit707c6420b1ea599c223a17781185c0b6fb0f3518 ()
treea2346868eb1d59ed395dc3c78327f1630b5d0b5a /vm.c
parent429b867d1b2de9dcdd558b13c3c9ab54e94e5a9b (diff)
Don't reference update frames with VM_FRAME_MAGIC_DUMMY
Frames with VM_FRAME_MAGIC_DUMMY pushed by rb_vm_push_frame_fname have allocated iseq, so we should not reference update it.
Notes: Merged: https://.com/ruby/ruby/pull/12371
-rw-r--r--vm.c28
1 files changed, 15 insertions, 13 deletions
@@ -3367,20 +3367,22 @@ rb_execution_context_update(rb_execution_context_t *ec)
}
while (cfp != limit_cfp) {
- const VALUE *ep = cfp->ep;
- cfp->self = rb_gc_location(cfp->self);
- cfp->iseq = (rb_iseq_t *)rb_gc_location((VALUE)cfp->iseq);
- cfp->block_code = (void *)rb_gc_location((VALUE)cfp->block_code);
-
- if (!VM_ENV_LOCAL_P(ep)) {
- const VALUE *prev_ep = VM_ENV_PREV_EP(ep);
- if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) {
- VM_FORCE_WRITE(&prev_ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(prev_ep[VM_ENV_DATA_INDEX_ENV]));
- }
- if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) {
- VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(ep[VM_ENV_DATA_INDEX_ENV]));
- VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ME_CREF], rb_gc_location(ep[VM_ENV_DATA_INDEX_ME_CREF]));
}
}