Fix a missing write barrier to mandatory_only_iseq

Found by wbcheck
This commit is contained in:
John Hawthorn 2025-06-07 18:37:46 -07:00
parent 6b3fa23563
commit db5724894f
Notes: git 2025-06-18 17:18:25 +00:00
2 changed files with 4 additions and 2 deletions

View file

@ -3497,7 +3497,7 @@ pm_compile_builtin_mandatory_only_method(rb_iseq_t *iseq, pm_scope_node_t *scope
pm_scope_node_init(&def.base, &next_scope_node, scope_node);
int error_state;
ISEQ_BODY(iseq)->mandatory_only_iseq = pm_iseq_new_with_opt(
const rb_iseq_t *mandatory_only_iseq = pm_iseq_new_with_opt(
&next_scope_node,
rb_iseq_base_label(iseq),
rb_iseq_path(iseq),
@ -3509,6 +3509,7 @@ pm_compile_builtin_mandatory_only_method(rb_iseq_t *iseq, pm_scope_node_t *scope
ISEQ_COMPILE_DATA(iseq)->option,
&error_state
);
RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->mandatory_only_iseq, (VALUE)mandatory_only_iseq);
if (error_state) {
RUBY_ASSERT(ISEQ_BODY(iseq)->mandatory_only_iseq == NULL);