なかだです。 At Mon, 20 Oct 2003 20:33:21 +0900, Masatoshi Seki wrote: > >> Linuxでのバックトレースをつけます。 > >> > >> (gdb) bt > >> #0 rb_yield_0 (val=4, self=1075691532, klass=0, flags=0, avalue=2) > >> at eval.c:4174 > > > > これってrb_warn()の行ですか。だとしたら、*currはどうなってるで > > しょうか。 > > linuxではうまく印字できなかったのですが、osxではこんな感じです。 > > (gdb) p curr > $1 = (NODE *) 0x0 > (gdb) p *curr > Cannot access memory at address 0x0 [ruby-dev:21551]の影響で、空のブロックを呼ぶとruby_current_node が0になってしまっていたようです。 * eval.c (rb_eval): set current node after arguments evaluation. [ruby-dev:21632] * eval.c (rb_eval): keep current node if body is empty.
Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.569 diff -u -2 -p -r1.569 eval.c --- eval.c 20 Oct 2003 13:01:21 -0000 1.569 +++ eval.c 20 Oct 2003 13:34:52 -0000 @@ -2810,4 +2810,5 @@ rb_eval(self, n) if (node->nd_head) { result = rb_eval(self, node->nd_head); + ruby_current_node = node; } else { @@ -2994,4 +2995,5 @@ rb_eval(self, n) END_CALLARGS; + ruby_current_node = node; SET_CURRENT_SOURCE(); rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,scope); @@ -3011,4 +3013,5 @@ rb_eval(self, n) END_CALLARGS; + ruby_current_node = node; SET_CURRENT_SOURCE(); result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0); @@ -3025,4 +3028,5 @@ rb_eval(self, n) END_CALLARGS; + ruby_current_node = node; SET_CURRENT_SOURCE(); result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,1); @@ -3059,4 +3063,5 @@ rb_eval(self, n) SETUP_ARGS(node->nd_args); END_CALLARGS; + ruby_current_node = node; } @@ -7055,5 +7060,5 @@ proc_invoke(proc, args, self, klass) PUSH_ITER(ITER_CUR); ruby_frame->iter = ITER_CUR; - ruby_current_node = data->body; + if (data->body) ruby_current_node = data->body; PUSH_TAG((pcall || orphan) ? PROT_PCALL : PROT_CALL); state = EXEC_TAG();
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦