From 40e67cb20e2da8eda655f3164e75fdc504042e95 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 22 Nov 2023 11:11:08 -0500 Subject: Implement Write Barriers on proc_entry --- enumerator.c | 6 +++--- 1 file 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); -- cgit v1.2.3