@@ -3476,7 +3476,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
34763476 iobj -> insn_id = BIN (opt_ary_freeze );
34773477 iobj -> operand_size = 2 ;
34783478 iobj -> operands = compile_data_calloc2 (iseq , iobj -> operand_size , sizeof (VALUE ));
3479- iobj -> operands [0 ] = rb_cArray_empty_frozen ;
3479+ RB_OBJ_WRITE ( iseq , & iobj -> operands [0 ], rb_cArray_empty_frozen ) ;
34803480 iobj -> operands [1 ] = (VALUE )ci ;
34813481 ELEM_REMOVE (next );
34823482 }
@@ -3499,7 +3499,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
34993499 iobj -> insn_id = BIN (opt_hash_freeze );
35003500 iobj -> operand_size = 2 ;
35013501 iobj -> operands = compile_data_calloc2 (iseq , iobj -> operand_size , sizeof (VALUE ));
3502- iobj -> operands [0 ] = rb_cHash_empty_frozen ;
3502+ RB_OBJ_WRITE ( iseq , & iobj -> operands [0 ], rb_cHash_empty_frozen ) ;
35033503 iobj -> operands [1 ] = (VALUE )ci ;
35043504 ELEM_REMOVE (next );
35053505 }
@@ -4059,7 +4059,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
40594059 unsigned int flags = vm_ci_flag (ci );
40604060 if ((flags & set_flags ) == set_flags && !(flags & unset_flags )) {
40614061 ((INSN * )niobj )-> insn_id = BIN (putobject );
4062- OPERAND_AT (niobj , 0 ) = rb_hash_freeze (rb_hash_resurrect (OPERAND_AT (niobj , 0 )));
4062+ RB_OBJ_WRITE ( iseq , & OPERAND_AT (niobj , 0 ), rb_hash_freeze (rb_hash_resurrect (OPERAND_AT (niobj , 0 ) )));
40634063
40644064 const struct rb_callinfo * nci = vm_ci_new (vm_ci_mid (ci ),
40654065 flags & ~VM_CALL_KW_SPLAT_MUT , vm_ci_argc (ci ), vm_ci_kwarg (ci ));
@@ -9151,12 +9151,13 @@ compile_builtin_mandatory_only_method(rb_iseq_t *iseq, const NODE *node, const N
91519151
91529152 VALUE ast_value = rb_ruby_ast_new (RNODE (& scope_node ));
91539153
9154- ISEQ_BODY ( iseq ) -> mandatory_only_iseq =
9154+ const rb_iseq_t * mandatory_only_iseq =
91559155 rb_iseq_new_with_opt (ast_value , rb_iseq_base_label (iseq ),
91569156 rb_iseq_path (iseq ), rb_iseq_realpath (iseq ),
91579157 nd_line (line_node ), NULL , 0 ,
91589158 ISEQ_TYPE_METHOD , ISEQ_COMPILE_DATA (iseq )-> option ,
91599159 ISEQ_BODY (iseq )-> variable .script_lines );
9160+ RB_OBJ_WRITE (iseq , & ISEQ_BODY (iseq )-> mandatory_only_iseq , (VALUE )mandatory_only_iseq );
91609161
91619162 ALLOCV_END (idtmp );
91629163 return COMPILE_OK ;
@@ -13141,7 +13142,7 @@ ibf_dump_catch_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
1314113142}
1314213143
1314313144static struct iseq_catch_table *
13144- ibf_load_catch_table (const struct ibf_load * load , ibf_offset_t catch_table_offset , unsigned int size )
13145+ ibf_load_catch_table (const struct ibf_load * load , ibf_offset_t catch_table_offset , unsigned int size , const rb_iseq_t * parent_iseq )
1314513146{
1314613147 if (size ) {
1314713148 struct iseq_catch_table * table = ruby_xmalloc (iseq_catch_table_bytes (size ));
@@ -13158,7 +13159,8 @@ ibf_load_catch_table(const struct ibf_load *load, ibf_offset_t catch_table_offse
1315813159 table -> entries [i ].cont = (unsigned int )ibf_load_small_value (load , & reading_pos );
1315913160 table -> entries [i ].sp = (unsigned int )ibf_load_small_value (load , & reading_pos );
1316013161
13161- table -> entries [i ].iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )iseq_index );
13162+ rb_iseq_t * catch_iseq = (rb_iseq_t * )ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )iseq_index );
13163+ RB_OBJ_WRITE (parent_iseq , & table -> entries [i ].iseq , catch_iseq );
1316213164 }
1316313165 return table ;
1316413166 }
@@ -13663,10 +13665,14 @@ ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
1366313665 load_body -> insns_info .body = ibf_load_insns_info_body (load , insns_info_body_offset , insns_info_size );
1366413666 load_body -> insns_info .positions = ibf_load_insns_info_positions (load , insns_info_positions_offset , insns_info_size );
1366513667 load_body -> local_table = ibf_load_local_table (load , local_table_offset , local_table_size );
13666- load_body -> catch_table = ibf_load_catch_table (load , catch_table_offset , catch_table_size );
13667- load_body -> parent_iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )parent_iseq_index );
13668- load_body -> local_iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )local_iseq_index );
13669- load_body -> mandatory_only_iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )mandatory_only_iseq_index );
13668+ load_body -> catch_table = ibf_load_catch_table (load , catch_table_offset , catch_table_size , iseq );
13669+ const rb_iseq_t * parent_iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )parent_iseq_index );
13670+ const rb_iseq_t * local_iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )local_iseq_index );
13671+ const rb_iseq_t * mandatory_only_iseq = ibf_load_iseq (load , (const rb_iseq_t * )(VALUE )mandatory_only_iseq_index );
13672+
13673+ RB_OBJ_WRITE (iseq , & load_body -> parent_iseq , parent_iseq );
13674+ RB_OBJ_WRITE (iseq , & load_body -> local_iseq , local_iseq );
13675+ RB_OBJ_WRITE (iseq , & load_body -> mandatory_only_iseq , mandatory_only_iseq );
1367013676
1367113677 // This must be done after the local table is loaded.
1367213678 if (load_body -> param .keyword != NULL ) {
0 commit comments