Hi,

2009/08/09 1:29 に Mark Moseley<redmine / ruby-lang.org> さんは書きました:
> Patch to fix this:
>
> --- compile.c   (revision 24476)
> +++ compile.c   (working copy)
> @@ -2959,6 +2959,8 @@
>        COMPILE_(ret, "BLOCK body", node->nd_head,
>             (node->nd_next == 0 && poped == 0) ? 0 : 1);
>        node = node->nd_next;
> +       if (node)
> +           iseq->compile_data->last_line = nd_line(node);
>    }
>    if (node) {
>        COMPILE_(ret, "BLOCK next", node->nd_next, poped);


wanabe reports an unexpected behavior in which return event should be
fired but not when foo(true) is called.  This will be fixed by the
following patch:


Index: compile.c
===================================================================
--- compile.c	(revision 24578)
+++ compile.c	(working copy)
@@ -4205,6 +4205,7 @@

 		if (is->type == ISEQ_TYPE_METHOD) {
 		    add_ensure_iseq(ret, iseq, 1);
+		    ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
 		    ADD_INSN(ret, nd_line(node), leave);
 		    ADD_ADJUST_RESTORE(ret, splabel);


Your patch fixes line number of return event.  Indeed, the line number
is wrong, which is another problem.
In place of ko1, I'll checking both the problem and [ruby-core:24463]
with your whole patch (http://gist.github.com/166330) later.

Anyway, thank you for your patch.

-- 
Yusuke ENDOH <mame / tsg.ne.jp>