# \[Bug #1674\] set\_trace\_func with 1line block

**URL:** <https://www.ruby-forum.com/t/bug-1674-set-trace-func-with-1line-block/170728>\
**Category:** Development\
**Created:** [June 22, 2009, 3:21am UTC](https://www.ruby-forum.com/t/bug-1674-set-trace-func-with-1line-block/170728 "2009-06-22T03:21:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSwanabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Post date:** [June 22, 2009, 3:21am UTC](https://www.ruby-forum.com/t/bug-1674-set-trace-func-with-1line-block/170728/1 "2009-06-22T03:21:35Z")

</div>

Bug #1674: set\_trace\_func with 1line block  
[http://redmine.ruby-lang.org/issues/show/1674](http://redmine.ruby-lang.org/issues/show/1674)

e$B5/I\<\<Te(B: \_ wanabe  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Low  
e$B%+%F%4%je(B: core  
ruby -v: ruby 1.9.2dev (2009-06-21 trunk 23809) [i386-mingw32]

e$BFbMF$,e(B1e$B9T$@$1$N%V%m%C%/$r\<B9T$9$k$He(B  
set\_trace\_funce$B$G4|BTDL$j$N9THV9f$,F@$i$l$^$;$s!#e(B

$ ruby -ve ’  
set\_trace\_func(proc{|type, file, line, \*a|  
p [file, line] if type == “line”  
})  
iseq = RubyVM::InstructionSequence.compile(“\n1.upto(2) {\n\np  
true\n\n}”)  
iseq.eval  
puts iseq.disasm  
’  
ruby 1.9.2dev (2009-06-21 trunk 23809) [i386-mingw32]  
[“-e”, 5]  
[“-e”, 6]  
[“”, 2]  
[“”, 2]  
true  
[“”, 2]  
true  
[“-e”, 7]  
== disasm: \<RubyVM::InstructionSequence:@\>==========  
== catch table

| catch type: break st: 0002 ed: 0012 sp: 0000 cont: 0012 |
| --- |
| 0000 trace 1 ( |

1. 

0002 putobject 1  
0004 putobject 2  
0006 send :upto, 1, block in , 0,   
0012 leave  
== disasm: \<RubyVM::InstructionSequence:block in @\>=  
== catch table  
| catch type: redo st: 0000 ed: 0011 sp: 0000 cont: 0000

| catch type: next st: 0000 ed: 0011 sp: 0000 cont: 0011 |
| --- |
| 0000 trace 1 ( |

1. 

0002 putnil  
0003 putobject true (  
4)  
0005 send :p, 1, nil, 8, (  
2)  
0011 leave (  
4)

---

<div class="post-metadata">

**Author:** ![SSwanabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Post date:** [June 22, 2009, 8:16am UTC](https://www.ruby-forum.com/t/bug-1674-set-trace-func-with-1line-block/170728/2 "2009-06-22T08:16:13Z")

</div>

e$B%A%1%C%He(B #1674 e$B$,99?7$5$l$^$7$?!#e(B (by \_ wanabe)

set\_trace\_funce$B$@$1$G$J$/Nc30$N%P%C%/%H%l!\<%9I=\<($G$bF1MM$G$7$?!#e(B

$ ruby -e ‘1.upto(2) {  
raise  
}’  
-e:1:in `block in <main>': unhandled exception from -e:1:in `upto’  
from -e:1:in `’

e$B$^$?!"J8F,$K%;%\_%3%m%s$rIU$1$k$H@5$7$$9THV9f$K$J$j$^$7$?!#e(B

$ ruby -e ‘1.upto(2) {  
;raise  
}’  
-e:2:in `block in <main>': unhandled exception from -e:1:in `upto’  
from -e:1:in `’

* * *

[http://redmine.ruby-lang.org/issues/show/1674](http://redmine.ruby-lang.org/issues/show/1674)

---

<div class="post-metadata">

**Author:** ![SSwanabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Post date:** [July 22, 2009, 3:48pm UTC](https://www.ruby-forum.com/t/bug-1674-set-trace-func-with-1line-block/170728/3 "2009-07-22T15:48:02Z")

</div>

e$B%A%1%C%He(B #1674 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r24243.

[http://redmine.ruby-lang.org/issues/show/1674](http://redmine.ruby-lang.org/issues/show/1674)

---

<div class="post-metadata">

**Author:** ![SSwanabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Post date:** [June 23, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/bug-1674-set-trace-func-with-1line-block/170728/4 "2009-06-23T16:39:31Z")

</div>

e$B1sF#$G$9!#e(B

2009/06/22 15:15 e$B$Ke(B \_ wanabe[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
e$B$5$s$O=q$-$^$7$?e(B:

> set\_trace\_funce$B$@$1$G$J$/Nc30$N%P%C%/%H%l!\<%9I=\<($G$bF1MM$G$7$?!#e(B
> 
> $ ruby -e ‘1.upto(2) {  
> raise  
> }’  
> -e:1:in `block in <main>': unhandled exception from -e:1:in `upto’  
> from -e:1:in `’

e$B%+%P%l%C%8B,Dj5!G=$K$b1F6A$,$"$C$?$N$GD4$Y$F$\_$^$7$?!#e(B

r19592 e$B$Ge(B Proc#source\_location e$B$J$I$,F3F~$5$l$?$H$-!"e(B  
brace\_block e$B$G9THV9f$r$$$8$k$h$&$K$J$C$?$N$,860x$N$h$&$G$9!#e(B

1: f = proc {  
2: x  
3: }  
4: p f.source\_location #=\> 1

e$B$H$$$&5sF0$r\<B8=$9$k$?$a$K!“%V%m%C%/$N@hF,$”$?$j$N%N!\<%I$Ne(B  
e$B9THV9f$rL5M}$d$je(B ‘{’ e$B$N$"$k9T$NHV9f$K=q$-49$($k$h$&$G$9$,!“e(B  
e$B$A$g$C$He(B ad-hoc e$B$@$H;W$$$^$9!#$^$?!”%+%P%l%C%8$NB,Dj$,JQ$Ke(B  
e$B$J$k$N$G\<B:]LdBj$H$7$F$b:$$j$^$9!#e(B

rb\_iseq\_struct e$B$K9THV9f$r;}$?$;$k$h$&$K$7$F$\_$^$7$?!#e(B  
e$B$\*$^$1$N8z2L$H$7$F!"e(Bset\_trace\_func e$B$Ne(B class/end  
e$B%$%Y%s%H$de(B  
call/return e$B%$%Y%s%H$N9THV9f$re(Bruby 1.8 e$B$HF1$8$K$G$-$^$7$?!#e(B

# Index: vm\_core.h

— vm\_core.h (revision 23832)  
+++ vm\_core.h (working copy)  
@@ -132,6 +132,7 @@  
unsigned long iseq\_size;  
VALUE mark\_ary; /\* Array: includes operands which should be GC  
marked _/  
VALUE coverage; /_ coverage array \*/

- unsigned short line\_no;

static VALUE  
prepare\_iseq\_build(rb\_iseq\_t \*iseq,

- 

```
  VALUE name, VALUE filename,

```

- 

```
  VALUE name, VALUE filename, VALUE line_no,
  VALUE parent, VALUE type, VALUE block_opt,
  const rb_compile_option_t *option)

```

{  
@@ -211,6 +211,7 @@

```
 iseq->name = name;
 iseq->filename = filename;

```

- iseq-\>line\_no = line\_no;  
iseq-\>defined\_method\_id = 0;  
iseq-\>mark\_ary = rb\_ary\_new();  
RBASIC(iseq-\>mark\_ary)-\>klass = 0;  
@@ -354,14 +355,14 @@  
rb\_iseq\_new(NODE \*node, VALUE name, VALUE filename,  
VALUE parent, VALUE type)  
{

- return rb\_iseq\_new\_with\_opt(node, name, filename, parent, type,

- return rb\_iseq\_new\_with\_opt(node, name, filename, INT2FIX(0),  
parent, type,  
&COMPILE\_OPTION\_DEFAULT);  
}

VALUE  
rb\_iseq\_new\_top(NODE \*node, VALUE name, VALUE filename, VALUE parent)  
{

- return rb\_iseq\_new\_with\_opt(node, name, filename, parent,  
ISEQ\_TYPE\_TOP,

- return rb\_iseq\_new\_with\_opt(node, name, filename, INT2FIX(0),  
parent, ISEQ\_TYPE\_TOP,  
&COMPILE\_OPTION\_DEFAULT);  
}

@@ -370,12 +371,12 @@  
{  
rb\_thread\_t \*th = GET\_THREAD();  
VALUE parent = th-\>base\_block-\>iseq-\>self;

- return rb\_iseq\_new\_with\_opt(node, rb\_str\_new2(“”), filename,

- return rb\_iseq\_new\_with\_opt(node, rb\_str\_new2(“”),  
filename, INT2FIX(0),  
parent, ISEQ\_TYPE\_MAIN, &COMPILE\_OPTION\_DEFAULT);  
}

static VALUE  
-rb\_iseq\_new\_with\_bopt\_and\_opt(NODE \*node, VALUE name, VALUE filename,  
+rb\_iseq\_new\_with\_bopt\_and\_opt(NODE \*node, VALUE name, VALUE filename,  
VALUE line\_no,  
VALUE parent, VALUE type, VALUE bopt,  
const rb\_compile\_option\_t \*option)  
{  
@@ -385,28 +386,28 @@  
GetISeqPtr(self, iseq);  
iseq-\>self = self;

- prepare\_iseq\_build(iseq, name, filename, parent, type, bopt,  
option);

- prepare\_iseq\_build(iseq, name, filename, line\_no, parent, type,  
bopt, option);  
rb\_iseq\_compile\_node(self, node);  
cleanup\_iseq\_build(iseq);  
return self;  
}

VALUE  
-rb\_iseq\_new\_with\_opt(NODE \*node, VALUE name, VALUE filename,  
+rb\_iseq\_new\_with\_opt(NODE \*node, VALUE name, VALUE filename, VALUE  
line\_no,  
VALUE parent, VALUE type,  
const rb\_compile\_option\_t _option)  
{  
/_ TODO: argument check \*/

- return rb\_iseq\_new\_with\_bopt\_and\_opt(node, name, filename, parent,  
type,

- return rb\_iseq\_new\_with\_bopt\_and\_opt(node, name, filename,  
line\_no, parent, type,  
Qfalse, option);  
}

VALUE  
-rb\_iseq\_new\_with\_bopt(NODE \*node, VALUE name, VALUE filename,  
+rb\_iseq\_new\_with\_bopt(NODE _node, VALUE name, VALUE filename, VALUE  
line\_no,  
VALUE parent, VALUE type, VALUE bopt)  
{  
/_ TODO: argument check \*/

- return rb\_iseq\_new\_with\_bopt\_and\_opt(node, name, filename, parent,  
type,

- return rb\_iseq\_new\_with\_bopt\_and\_opt(node, name, filename,  
line\_no, parent, type,  
bopt, &COMPILE\_OPTION\_DEFAULT);  
}

@@ -420,7 +421,7 @@  
VALUE iseqval = iseq\_alloc(self);

```
 VALUE magic, version1, version2, format_type, misc;

```

- VALUE name, filename;

- VALUE name, filename, line\_no;  
VALUE type, body, locals, args, exception;

- 

```
* name, filename,

```

- 

```
* name, filename, line_no,
* type, locals, args, exception_table, body]
*/

```

@@ -444,6 +445,7 @@

```
 name = CHECK_STRING(rb_ary_entry(data, i++));
 filename = CHECK_STRING(rb_ary_entry(data, i++));

```

- line\_no = CHECK\_INTEGER(rb\_ary\_entry(data, i++));

- prepare\_iseq\_build(iseq, name, filename,

- prepare\_iseq\_build(iseq, name, filename, line\_no,  
parent, iseq\_type, 0, &option);

- 

```
       file, th->base_block->iseq->self,

```

- 

```
       file, line, th->base_block->iseq->self,
       ISEQ_TYPE_EVAL, &option);

```

}  
else {

- return rb\_iseq\_new\_with\_opt(node, rb\_str\_new2(“”), file,  
Qfalse,

- return rb\_iseq\_new\_with\_opt(node, rb\_str\_new2(“”), file,  
line, Qfalse,  
ISEQ\_TYPE\_TOP, &option);  
}  
}  
@@ -582,7 +584,7 @@  
parser = rb\_parser\_new();  
node = rb\_parser\_compile\_file(parser, fname, f, NUM2INT(line));  
make\_compile\_option(&option, opt);

- return rb\_iseq\_new\_with\_opt(node, rb\_str\_new2(“”), file,  
Qfalse,

- return rb\_iseq\_new\_with\_opt(node, rb\_str\_new2(“”), file,  
line, Qfalse,  
ISEQ\_TYPE\_TOP, &option);  
}

@@ -648,7 +650,7 @@  
int  
rb\_iseq\_first\_lineno(rb\_iseq\_t \*iseq)  
{

- return iseq-\>insn\_info\_table[0].line\_no;

- return FIX2INT(iseq-\>line\_no);  
}

/\* TODO: search algorithm is brute force.  
@@ -1290,7 +1292,7 @@

```
 /*
  * [:magic, :major_version, :minor_version, :format_type, :misc,

```

- 

```
* :name, :filename, :type, :locals, :args,

```

- 

```
* :name, :filename, :line_no, :type, :locals, :args,
* :catch_table, :bytecode]
*/

```

rb\_ary\_push(val,  
rb\_str\_new2(“YARVInstructionSequence/SimpleDataFormat”));  
@@ -1300,6 +1302,7 @@  
rb\_ary\_push(val, misc);  
rb\_ary\_push(val, iseq-\>name);  
rb\_ary\_push(val, iseq-\>filename);
- rb\_ary\_push(val, iseq-\>line\_no);  
rb\_ary\_push(val, type);  
rb\_ary\_push(val, locals);  
rb\_ary\_push(val, args);  
@@ -1406,7 +1409,8 @@  
const VALUE \*arg\_opt\_table,  
const struct iseq\_catch\_table\_entry \*catch\_table,  
const char \*name,

- const char \*filename)

- const char \*filename,
- const unsigned short line\_no)  
{  
int i;  
VALUE iseqval = iseq\_alloc(rb\_cISeq);  
@@ -1417,6 +1421,7 @@  
\*iseq = \*iseq\_template;  
iseq-\>name = rb\_str\_new2(name);  
iseq-\>filename = rb\_str\_new2(filename);
- iseq-\>line\_no = line\_no;  
iseq-\>mark\_ary = rb\_ary\_tmp\_new(3);  
iseq-\>self = iseqval;

# Index: compile.c

— compile.c (revision 23832)  
+++ compile.c (working copy)  
@@ -167,15 +167,12 @@  
#define iseq\_filename(iseq)   
(((rb\_iseq\_t\*)DATA\_PTR(iseq))-\>filename)

-#define NEW\_ISEQVAL(node, name, type) \

- new\_child\_iseq(iseq, node, name, 0, type)  
+#define NEW\_ISEQVAL(node, name, type, line\_no) \

- new\_child\_iseq(iseq, node, name, 0, type, line\_no)

-#define NEW\_CHILD\_ISEQVAL(node, name, type) \

- new\_child\_iseq(iseq, node, name, iseq-\>self, type)  
+#define NEW\_CHILD\_ISEQVAL(node, name, type, line\_no) \

- new\_child\_iseq(iseq, node, name, iseq-\>self, type, line\_no)

-#define NEW\_SPECIAQL\_BLOCK\_ISEQVAL(iseq, sym) \

- new\_child\_iseq(iseq, iseq-\>node, iseq-\>name, iseq-\>parent\_iseq,  
iseq-\>type, sym)
- 

/\* add instructions \*/  
#define ADD\_SEQ(seq1, seq2)   
APPEND\_LIST(seq1, seq2)  
@@ -448,13 +445,13 @@  
break;  
}  
case ISEQ\_TYPE\_CLASS: {

- 

```
 ADD_TRACE(ret, nd_line(node), RUBY_EVENT_CLASS);

```

- 

```
 ADD_TRACE(ret, FIX2INT(iseq->line_no), RUBY_EVENT_CLASS);
 COMPILE(ret, "scoped node", node->nd_body);
 ADD_TRACE(ret, nd_line(node), RUBY_EVENT_END);
 break;

```

}  
case ISEQ\_TYPE\_METHOD: {

- 

```
 ADD_TRACE(ret, nd_line(node), RUBY_EVENT_CALL);

```

- 

```
 ADD_TRACE(ret, FIX2INT(iseq->line_no), RUBY_EVENT_CALL);
 COMPILE(ret, "scoped node", node->nd_body);
 ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
 break;

```

@@ -911,12 +908,12 @@

static VALUE  
new\_child\_iseq(rb\_iseq\_t \*iseq, NODE \*node,

- 

```
    VALUE name, VALUE parent, VALUE type)

```

- 

```
    VALUE name, VALUE parent, VALUE type, int line_no)

```

{  
VALUE ret;

```
 debugs("[new_child_iseq]> 

```

---------------------------------------\n");

- ret = rb\_iseq\_new\_with\_opt(node, name, iseq\_filename(iseq-\>self),

- ret = rb\_iseq\_new\_with\_opt(node, name, iseq\_filename(iseq-\>self),  
INT2FIX(line\_no),  
parent, type, iseq-\>compile\_data-\>option);  
debugs(“[new\_child\_iseq]\<  
---------------------------------------\n”);  
iseq\_add\_mark\_object(iseq, ret);  
@@ -2686,7 +2683,7 @@  
rb\_str\_concat(rb\_str\_new2  
("defined guard in "),  
iseq-\>name),

- 

```
          ISEQ_TYPE_DEFINED_GUARD);

```

- 

```
          ISEQ_TYPE_DEFINED_GUARD, 0);

 defined_expr(iseq, ret, node->nd_recv, lfinish, Qfalse);
 ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);

```

@@ -3264,7 +3261,7 @@

```
   iseq->compile_data->current_block =
 NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),

```

- 

```
     ISEQ_TYPE_BLOCK);

```

- 

```
     ISEQ_TYPE_BLOCK, nd_line(node));

 mid = idEach;
 ADD_SEND_R(ret, nd_line(node), ID2SYM(idEach), INT2FIX(0),

```

@@ -3273,7 +3270,7 @@  
else {  
iseq-\>compile\_data-\>current\_block =  
NEW\_CHILD\_ISEQVAL(node-\>nd\_body, make\_name\_for\_block(iseq),

- 

```
     ISEQ_TYPE_BLOCK);

```

- 

```
     ISEQ_TYPE_BLOCK, nd_line(node));
 COMPILE(ret, "iter caller", node->nd_iter);

```

}  
ADD\_LABEL(ret, retry\_end\_l);  
@@ -3507,7 +3504,7 @@  
VALUE rescue = NEW\_CHILD\_ISEQVAL(  
node-\>nd\_resq,  
rb\_str\_concat(rb\_str\_new2("rescue in "), iseq-\>name),

- 

```
 ISEQ_TYPE_RESCUE);

```

- 

```
 ISEQ_TYPE_RESCUE, nd_line(node));

```

ADD\_LABEL(ret, lstart);  
COMPILE(ret, “rescue head”, node-\>nd\_head);  
@@ -3589,7 +3586,7 @@  
rb\_str\_concat(rb\_str\_new2  
("ensure in "),  
iseq-\>name),

- 

```
      ISEQ_TYPE_ENSURE);

```

- 

```
      ISEQ_TYPE_ENSURE, nd_line(node));

```

LABEL \*lstart = NEW\_LABEL(nd\_line(node));  
LABEL \*lend = NEW\_LABEL(nd\_line(node));  
LABEL \*lcont = NEW\_LABEL(nd\_line(node));  
@@ -4503,7 +4500,7 @@  
case NODE\_DEFN:{  
VALUE iseqval = NEW\_ISEQVAL(node-\>nd\_defn,  
rb\_str\_dup(rb\_id2str(node-\>nd\_mid)),

- 

```
       ISEQ_TYPE_METHOD);

```

- 

```
       ISEQ_TYPE_METHOD, nd_line(node));

```

debugp\_param(“defn/iseq”, iseqval);

@@ -4523,7 +4520,7 @@  
case NODE\_DEFS:{  
VALUE iseqval = NEW\_ISEQVAL(node-\>nd\_defn,  
rb\_str\_dup(rb\_id2str(node-\>nd\_mid)),

- 

```
       ISEQ_TYPE_METHOD);

```

- 

```
       ISEQ_TYPE_METHOD, nd_line(node));

```

debugp\_param(“defs/iseq”, iseqval);

@@ -4577,7 +4574,7 @@  
NEW\_CHILD\_ISEQVAL(  
node-\>nd\_body,  
rb\_sprintf(“class:%s”, rb\_id2name(node-\>nd\_cpath-\>nd\_mid)),

- ISEQ\_TYPE\_CLASS);

- ISEQ\_TYPE\_CLASS, nd\_line(node));  
compile\_cpath(ret, iseq, node-\>nd\_cpath);  
COMPILE(ret, “super”, node-\>nd\_super);  
ADD\_INSN3(ret, nd\_line(node), defineclass,  
@@ -4592,7 +4589,7 @@  
VALUE iseqval = NEW\_CHILD\_ISEQVAL(  
node-\>nd\_body,  
rb\_sprintf(“module:%s”, rb\_id2name(node-\>nd\_cpath-\>nd\_mid)),

- 

```
 ISEQ_TYPE_CLASS);

```

- 

```
 ISEQ_TYPE_CLASS, nd_line(node));

```

compile\_cpath(ret, iseq, node-\>nd\_cpath);  
ADD\_INSN (ret, nd\_line(node), putnil); /\* dummy \*/  
@@ -4607,7 +4604,7 @@  
ID singletonclass;  
VALUE iseqval =  
NEW\_ISEQVAL(node-\>nd\_body, rb\_str\_new2(“singletonclass”),

- 

```
 ISEQ_TYPE_CLASS);

```

- 

```
 ISEQ_TYPE_CLASS, nd_line(node));

```

COMPILE(ret, “sclass#recv”, node-\>nd\_recv);  
ADD\_INSN (ret, nd\_line(node), putnil);  
@@ -4810,7 +4807,7 @@  
case NODE\_POSTEXE:{  
LABEL \*lstart = NEW\_LABEL(nd\_line(node));  
LABEL \*lend = NEW\_LABEL(nd\_line(node));

- VALUE block = NEW\_CHILD\_ISEQVAL(node-\>nd\_body,  
make\_name\_for\_block(iseq), ISEQ\_TYPE\_BLOCK);

- VALUE block = NEW\_CHILD\_ISEQVAL(node-\>nd\_body,  
make\_name\_for\_block(iseq), ISEQ\_TYPE\_BLOCK, nd\_line(node));

- VALUE block = NEW\_CHILD\_ISEQVAL(node-\>nd\_body,  
make\_name\_for\_block(iseq), ISEQ\_TYPE\_BLOCK);

- VALUE block = NEW\_CHILD\_ISEQVAL(node-\>nd\_body,  
make\_name\_for\_block(iseq), ISEQ\_TYPE\_BLOCK, nd\_line(node));  
VALUE argc = INT2FIX(0);  
ADD\_CALL\_RECEIVER(ret, nd\_line(node));  
ADD\_CALL\_WITH\_BLOCK(ret, nd\_line(node), ID2SYM(idLambda), argc,  
block);  
Index: parse.y  
===================================================================  
— parse.y (revision 23832)  
+++ parse.y (working copy)  
@@ -2897,7 +2897,6 @@  
reduce\_nodes(&body);  
$$ = NEW\_DEFN($2, $4, body, NOEX\_PRIVATE);  
fixpos($$, $4);

- 

```
 fixpos($$->nd_defn, $4);
 local_pop();
   /*%
 $$ = dispatch3(def, $2, $4, $5);

```

@@ -2923,7 +2922,6 @@  
reduce\_nodes(&body);  
$$ = NEW\_DEFS($2, $5, $7, body);  
fixpos($$, $2);

- 

```
 fixpos($$->nd_defn, $2);
 local_pop();
   /*%
 $$ = dispatch5(defs, $2, $3, $5, $7, $8);

```

@@ -3637,8 +3635,6 @@  
/_%%%_/  
$$ = NEW\_ITER($3,$4);  
nd\_set\_line($$, $2);

- 

```
 nd_set_line($$->nd_body, $<num>2);

```

- 

```
 nd_set_line($$->nd_body->nd_body, $<num>2);
 dyna_pop();
   /*%
 $$ = dispatch2(brace_block, escape_Qundef($3), $4);

```

# Index: test/ruby/test\_settracefunc.rb

— test/ruby/test\_settracefunc.rb (revision 23832)  
+++ test/ruby/test\_settracefunc.rb (working copy)  
@@ -68,7 +68,7 @@  
events.shift)  
assert\_equal([“c-return”, 5, :+, Fixnum],  
events.shift)

- assert\_equal([“return”, 4, :add, self.class],

- assert\_equal([“return”, 6, :add, self.class],  
events.shift)  
assert\_equal([“line”, 8, **method** , self.class],  
events.shift)  
@@ -98,7 +98,7 @@  
events.shift)  
assert\_equal([“c-return”, 4, :inherited, Class],  
events.shift)

- assert\_equal([“class”, 7, nil, nil],

- assert\_equal([“class”, 4, nil, nil],  
events.shift)  
assert\_equal([“line”, 5, nil, nil],  
events.shift)  
@@ -120,7 +120,7 @@  
events.shift)  
assert\_equal([“call”, 5, :bar, Foo],  
events.shift)

- assert\_equal([“return”, 5, :bar, Foo],

- assert\_equal([“return”, 6, :bar, Foo],  
events.shift)  
assert\_equal([“line”, 9, **method** , self.class],  
events.shift)
