diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-01 22:50:25 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-02 00:56:52 +0900 |
commit | 5872fd6f6cc5ddde33df94fb11e773eeb653e55e (patch) | |
tree | 50c3ca729f87bc4133d785deed77add4f7b767ab /struct.c | |
parent | a14a1a5626a4d8e661a3e606f8f92b8c455b9a04 (diff) |
[Feature #19163] Marshal-loaded Data object also should be frozen
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6843
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; } |