aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/variable.c b/variable.c
index cdfef85f46..af7c554f49 100644
--- a/variable.c
+++ b/variable.c
@@ -1550,8 +1550,7 @@ generic_ivar_set(VALUE obj, ID id, VALUE val)
}
RB_VM_LOCK_LEAVE();
- ivar_lookup.ivtbl->as.shape.ivptr[index] = val;
- RB_OBJ_WRITTEN(obj, Qundef, val);
+ RB_OBJ_WRITE(obj, &ivup.ivtbl->as.shape.ivptr[ivup.iv_index], val);
if (!found) {
rb_shape_set_shape(obj, shape);
@@ -1963,8 +1962,7 @@ rb_copy_generic_ivar(VALUE clone, VALUE obj)
new_ivtbl = gen_ivtbl_resize(0, obj_ivtbl->as.shape.numiv);
for (uint32_t i=0; i<obj_ivtbl->as.shape.numiv; i++) {
- new_ivtbl->as.shape.ivptr[i] = obj_ivtbl->as.shape.ivptr[i];
- RB_OBJ_WRITTEN(clone, Qundef, obj_ivtbl->as.shape.ivptr[i]);
+ RB_OBJ_WRITE(clone, &new_ivtbl->as.shape.ivptr[i], obj_ivtbl->as.shape.ivptr[i]);
}
}