[Feature #19163] Marshal-loaded Data object also should be frozen

This commit is contained in:
Nobuyoshi Nakada 2022-12-01 22:50:25 +09:00
parent a14a1a5626
commit 5872fd6f6c
Notes: git 2022-12-01 15:57:11 +00:00
2 changed files with 11 additions and 0 deletions

View file

@ -786,6 +786,7 @@ VALUE
rb_struct_initialize(VALUE self, VALUE values)
{
rb_struct_initialize_m(RARRAY_LENINT(values), RARRAY_CONST_PTR(values), self);
if (rb_obj_is_kind_of(self, rb_cData)) OBJ_FREEZE_RAW(self);
RB_GC_GUARD(values);
return Qnil;
}