summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-08 21:19:39 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-08 21:23:21 +0900
commit8a504b224f50d9b6fb32aa090c6125d52151700a (patch)
tree9492be7b657168de2d5fdcfb993381e74989b56d /struct.c
parentadf709a78534c1483ba851ccb0490464ca31503c (diff)
Added GC guard for splatted array
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index b66337ea25..be742fbee5 100644
--- a/struct.c
+++ b/struct.c
@@ -659,7 +659,9 @@ rb_struct_initialize_m(int argc, const VALUE *argv, VALUE self)
VALUE
rb_struct_initialize(VALUE self, VALUE values)
{
- return rb_struct_initialize_m(RARRAY_LENINT(values), RARRAY_CONST_PTR(values), self);
+ rb_struct_initialize_m(RARRAY_LENINT(values), RARRAY_CONST_PTR(values), self);
+ RB_GC_GUARD(values);
+ return Qnil;
}
static VALUE *