summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-04 14:59:12 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-04 14:59:12 +0900
commite8cee4915b280dab57ca4f916f36bea4eb7ebdf1 (patch)
tree127574d9d2fe15028bebc2e516d008d8e8553af3 /vm.c
parent82bbce826f7f170270856bec8ef852667028d143 (diff)
fix initialize order
`captured->code.val` should be initialize before because it can be a GC point by another ractor because `RB_OBJ_WRITE` can issue VM locking.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index bc3ec98..bdca822 100644
--- a/vm.c
+++ b/vm.c
@@ -905,8 +905,8 @@ vm_proc_create_from_captured(VALUE klass,
VM_ASSERT(VM_EP_IN_HEAP_P(GET_EC(), captured->ep));
/* copy block */
- RB_OBJ_WRITE(procval, &proc->block.as.captured.self, captured->self);
RB_OBJ_WRITE(procval, &proc->block.as.captured.code.val, captured->code.val);
+ RB_OBJ_WRITE(procval, &proc->block.as.captured.self, captured->self);
rb_vm_block_ep_update(procval, &proc->block, captured->ep);
vm_block_type_set(&proc->block, block_type);