From: nobu@... Date: 2007-05-30T03:35:17+09:00 Subject: [ruby-dev:30836] [BUG] SEGV at ZSUPER in a block なかだです。 http://pc11.2ch.net/test/read.cgi/tech/1178167650/498 で、以下 のコードがSEGVするという話が出てます。 class C0 def a(*args) p "C0#a", args end end class C1 < C0 def a() @h = Hash.new { super } end def b(k) @h[k] end end class C2 < C0 h = nil define_method(:a) { h = Hash.new { super } } define_method(:b) { |k| h[k] } end c2 = C2.new c2.a c2.b 10 c1 = C1.new c1.a c1.b 10 Index: eval.c =================================================================== --- eval.c (revision 12402) +++ eval.c (working copy) @@ -3505,4 +3505,8 @@ rb_eval(self, n) argv = RARRAY(RBASIC(ruby_scope)->klass)->ptr; } + else if (!ruby_scope->local_vars) { + argc = 0; + argv = 0; + } else { argv = ruby_scope->local_vars + 2; -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦