From: Yasuhiro Fukuma Date: 1999-04-17T10:30:40+09:00 Subject: [ruby-dev:6628] [BUG] 1.instance_variables ==> SEGV ----Next_Part(Sat_Apr_17_10:16:43_1999_41)-- Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit 福間@福岡 です。 以下がSEGVします: $ ruby-1.3 -ve '1.instance_variables' ruby 1.3.2 (1999-04-13) [i386-freebsd4.0] /tmp/rbc55908:1: [BUG] Segmentation fault $ ruby-1.3 -e ' > class Object > attr_accessor :foo > end > one, two = 1, 2 > one.foo = "hoge" > p one.instance_variables > p two.instance_variables > ' ["@foo"] nil とりあえず同封のpatchのようにしてみましたが、その前に generic_iv_tbl を きちんと初期化すべきでしょうか? # 気分的には two.iv == [] なんじゃないかという気もちょっとしますが… --- Yasuhiro Fukuma (福間 康弘) as Yasu.F @ Kitakyushu.Fukuoka.Japan Web site: http://www8.big.or.jp/~yasuf/ “InterNIC is NOT NSI!” ----Next_Part(Sat_Apr_17_10:16:43_1999_41)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=variable.c.diff --- variable.c.orig Wed Mar 24 17:52:34 1999 +++ variable.c Fri Apr 16 18:55:59 1999 @@ -926,7 +926,7 @@ if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) { st_table *tbl; - if (st_lookup(generic_iv_tbl, obj, &tbl)) { + if (generic_iv_tbl && st_lookup(generic_iv_tbl, obj, &tbl)) { ary = rb_ary_new(); st_foreach(tbl, ivar_i, ary); return ary; ----Next_Part(Sat_Apr_17_10:16:43_1999_41)----