GC guard catch_table_ary

Using RARRAY_CONST_PTR can cause the array object to not exist on the
stack, which could cause it to be GC'd or be moved by GC compaction. This
can cause RARRAY_CONST_PTR to point to the incorrect location if the
array is embedded and moved by GC compaction.

Fixes ruby/prism#2444.
This commit is contained in:
Peter Zhu 2024-02-16 15:14:05 -05:00
parent 170058ca9e
commit 2967b7eb76

View File

@ -1595,6 +1595,8 @@ iseq_insert_nop_between_end_and_cont(rb_iseq_t *iseq)
}
}
}
RB_GC_GUARD(catch_table_ary);
}
static int