[前][次][番号順一覧][スレッド一覧]

ruby-changes:61151

From: Nobuyoshi <ko1@a...>
Date: Fri, 8 May 2020 21:23:58 +0900 (JST)
Subject: [ruby-changes:61151] 8a504b224f (master): Added GC guard for splatted array

https://git.ruby-lang.org/ruby.git/commit/?id=8a504b224f

From 8a504b224f50d9b6fb32aa090c6125d52151700a Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 8 May 2020 21:19:39 +0900
Subject: Added GC guard for splatted array


diff --git a/struct.c b/struct.c
index b66337e..be742fb 100644
--- a/struct.c
+++ b/struct.c
@@ -659,7 +659,9 @@ rb_struct_initialize_m(int argc, const VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/struct.c#L659
 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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]