summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/class.c b/class.c
index 114df2bbd7..4ffb47c27a 100644
--- a/class.c
+++ b/class.c
@@ -446,9 +446,12 @@ cvc_table_copy(ID id, VALUE val, void *data)
ent = ALLOC(struct rb_cvar_class_tbl_entry);
ent->class_value = ctx->clone;
+ ent->cref = orig_entry->cref;
ent->global_cvar_state = orig_entry->global_cvar_state;
rb_id_table_insert(ctx->new_table, id, (VALUE)ent);
+ RB_OBJ_WRITTEN(ctx->clone, Qundef, ent->cref);
+
return ID_TABLE_CONTINUE;
}