summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 138006e..afc7853 100644
--- a/eval.c
+++ b/eval.c
@@ -1356,7 +1356,7 @@ rb_using_refinement(rb_cref_t *cref, VALUE klass, VALUE module)
FL_SET(module, RMODULE_IS_OVERLAID);
superclass = refinement_superclass(superclass);
c = iclass = rb_include_class_new(module, superclass);
- RCLASS_REFINED_CLASS(c) = klass;
+ RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
RCLASS_M_TBL(OBJ_WB_UNPROTECT(c)) =
RCLASS_M_TBL(OBJ_WB_UNPROTECT(module)); /* TODO: check unprotecting */
@@ -1365,8 +1365,8 @@ rb_using_refinement(rb_cref_t *cref, VALUE klass, VALUE module)
while (module && module != klass) {
FL_SET(module, RMODULE_IS_OVERLAID);
c = RCLASS_SET_SUPER(c, rb_include_class_new(module, RCLASS_SUPER(c)));
- RCLASS_REFINED_CLASS(c) = klass;
- module = RCLASS_SUPER(module);
+ RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
+ module = RCLASS_SUPER(module);
}
rb_hash_aset(CREF_REFINEMENTS(cref), klass, iclass);
}
@@ -1451,12 +1451,12 @@ add_activated_refinement(VALUE activated_refinements,
FL_SET(refinement, RMODULE_IS_OVERLAID);
superclass = refinement_superclass(superclass);
c = iclass = rb_include_class_new(refinement, superclass);
- RCLASS_REFINED_CLASS(c) = klass;
+ RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
refinement = RCLASS_SUPER(refinement);
while (refinement && refinement != klass) {
FL_SET(refinement, RMODULE_IS_OVERLAID);
c = RCLASS_SET_SUPER(c, rb_include_class_new(refinement, RCLASS_SUPER(c)));
- RCLASS_REFINED_CLASS(c) = klass;
+ RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
refinement = RCLASS_SUPER(refinement);
}
rb_hash_aset(activated_refinements, klass, iclass);