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

ruby-changes:69080

From: Aaron <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:46 +0900 (JST)
Subject: [ruby-changes:69080] 2440fafba0 (master): rb_struct_define_under needs a trailing NULL

https://git.ruby-lang.org/ruby.git/commit/?id=2440fafba0

From 2440fafba00b6646b312a0c74798523bfa44bfe9 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Mon, 12 Jul 2021 15:38:56 -0700
Subject: rb_struct_define_under needs a trailing NULL

The last parameter to rb_struct_define_under needs to be NULL otherwise
we can get a SEGV.
---
 yjit_iface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/yjit_iface.c b/yjit_iface.c
index 76eb4876c8..1cb455e0c3 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -1035,7 +1035,7 @@ rb_yjit_init(struct rb_yjit_options *options) https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L1035
     rb_define_method(cYjitDisasm, "disasm", yjit_disasm, 2);
     cYjitDisasmInsn = rb_struct_define_under(cYjitDisasm, "Insn", "address", "mnemonic", "op_str", NULL);
 #if RUBY_DEBUG
-    cYjitCodeComment = rb_struct_define_under(cYjitDisasm, "Comment", "address", "comment");
+    cYjitCodeComment = rb_struct_define_under(cYjitDisasm, "Comment", "address", "comment", NULL);
 #endif
 #endif
 
-- 
cgit v1.2.1


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

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