From 8a504b224f50d9b6fb32aa090c6125d52151700a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 8 May 2020 21:19:39 +0900 Subject: Added GC guard for splatted array --- struct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'struct.c') 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 * -- cgit v1.2.3