# Patch for ruby-Bugs-19304

**URL:** <https://www.ruby-forum.com/t/patch-for-ruby-bugs-19304/134945>\
**Category:** Development\
**Created:** [April 16, 2008, 1:59pm UTC](https://www.ruby-forum.com/t/patch-for-ruby-bugs-19304/134945 "2008-04-16T13:59:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wanabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/51bf81/32.png) [@wanabe](https://www.ruby-forum.com/u/wanabe)\
**Post date:** [April 16, 2008, 1:59pm UTC](https://www.ruby-forum.com/t/patch-for-ruby-bugs-19304/134945/1 "2008-04-16T13:59:42Z")

</div>

e$B%o%J%Y$H?=$7$^$9!#e(B

[ruby-Bugs-19304] e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B  
define\_method e$B$G:n$i$l$?%a%=%C%I$Ne(B return  
e$B$NHt$S@h$,D\>A0$N%U%l!\<%`$K$J$j$^$9!#e(B

e$B$G$9$,!“e(Brb\_mod\_define\_method() e$BCf$G$Oe(B iseq  
e$B$r%3%T!\<$;$:$Ke(B  
proc-\>block.iseq-\>defined\_method\_id = id;  
e$B$N$h$&$KCM$r=q$-9~$s$G$$$k$?$ae(B  
Proc e$B%\*%V%8%’%/%H$,=q$-49$($i$l$F8mG’\<1$5$l$k2DG=@-$,$”$j$^$9!#e(B  
iseq  
e$B$r0BA4$K%3%T!\<$9$kJ}K!$,$o$+$i$J$+$C$?$N$G$=$N$^$^$K$7$F$7$^$$$^$7$?!#e(B

define\_method e$B$Ke(B return e$B$r4^$s$@e(B Proc  
e$B%\*%V%8%’%/%H$rEO$7!"$5$i$K$=$l$re(B  
Proc  
e$B$H$7$F;H$$$^$o$9!"$H$$$&FC\<l$J\>lLL0J30$G$OLdBj$J$$$H;W$$$^$9!#e(B

# Index: vm\_insnhelper.c

— vm\_insnhelper.c (revision 15984)  
+++ vm\_insnhelper.c (working copy)  
@@ -1288,6 +1288,7 @@  
VALUE \*dfp = GET\_DFP();  
int is\_orphan = 1;

- pt = 0;  
/\*\*
  - check orphan:  
_/  
@@ -1296,6 +1297,11 @@  
if (VM\_FRAME\_TYPE(cfp) == FRAME\_MAGIC\_LAMBDA) {  
/_ in lambda \*/  
is\_orphan = 0;

- 

```
     if (BUILTIN_TYPE(cfp->iseq) != T_NODE) {

```

- 

```
   if (cfp->iseq->defined_method_id) {

```

- 

```
       pt = GET_DFP();

```

- 

```
   }

```

- 

```
     }
     break;
 }
   }

```

@@ -1311,7 +1317,9 @@  
vm\_localjump\_error(“unexpected return”, throwobj, TAG\_RETURN);  
}

- pt = GET\_LFP();

- if (!pt) {
- 

```
   pt = GET_LFP();

```

- }  
}  
else {  
rb\_bug(“isns(throw): unsupport throw type”);
