summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index def15b0186..3733669eab 100644
--- a/struct.c
+++ b/struct.c
@@ -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;
}