Patch for ruby-Bugs-19304

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
[email protected]$,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’<[email protected]$,$”$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^[email protected](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”);

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs