diff options
author | Peter Zhu <[email protected]> | 2023-11-22 11:11:08 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-11-29 22:51:13 -0500 |
commit | 40e67cb20e2da8eda655f3164e75fdc504042e95 (patch) | |
tree | 082fc202975f360143ad7824ab1e3b90b3057e29 /enumerator.c | |
parent | 705a3c69d7956b071d85bd785b8b61ffdf96c525 (diff) |
Implement Write Barriers on proc_entry
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 6 |
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); |