aboutsummaryrefslogtreecommitdiffstats
path: root/enumerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/enumerator.c b/enumerator.c
index 358ec8a83d..26bc9517cd 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -311,7 +311,7 @@ static const rb_data_type_t proc_entry_data_type = {
proc_entry_memsize,
proc_entry_compact,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};
static struct proc_entry *
@@ -1875,10 +1875,10 @@ lazy_add_method(VALUE obj, int argc, VALUE *argv, VALUE args, VALUE memo,
VALUE entry_obj = TypedData_Make_Struct(rb_cObject, struct proc_entry,
&proc_entry_data_type, entry);
if (rb_block_given_p()) {
- entry->proc = rb_block_proc();
+ RB_OBJ_WRITE(entry_obj, &entry->proc, rb_block_proc());
}
entry->fn = fn;
- entry->memo = args;
+ RB_OBJ_WRITE(entry_obj, &entry->memo, args);
lazy_set_args(entry_obj, memo);