Patch for [ruby-core:14537]

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

[ruby-core:14537]e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B
rescue e$B$N0z?t$KG[Ns$NE83+$r5v$9$h$&$K$7$^$7$?!#e(B

Index: compile.c

— compile.c (revision 15910)
+++ compile.c (working copy)
@@ -3211,11 +3211,27 @@

   narg = resq->nd_args;
   while (narg) {
  • COMPILE(ret, “rescue arg”, narg->nd_head);
  • ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),
  •    INT2FIX(0));
    
  • ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
  • ADD_INSNL(ret, nd_line(node), branchif, label_hit);
  • if (nd_type(narg) == NODE_SPLAT ||
  •    nd_type(narg) == NODE_ARGSCAT) {
    
  •    ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),
    
  •        INT2FIX(0));
    
  •    COMPILE(ret, "rescue arg", narg->nd_head);
    
  •    if (nd_type(narg) == NODE_ARGSCAT) {
    
  •  COMPILE(ret, "rescue argscat", narg->nd_body);
    
  •  ADD_INSN(ret, nd_line(node), concatarray);
    
  •    }
    
  •    ADD_INSN1(ret, nd_line(node), checkincludearray, Qtrue);
    
  •    ADD_INSN(ret, nd_line(node), swap);
    
  •    ADD_INSN(ret, nd_line(node), pop);
    
  •    ADD_INSNL(ret, nd_line(node), branchif, label_hit);
    
  • }
  • else {
  •    COMPILE(ret, "rescue arg", narg->nd_head);
    
  •    ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),
    
  •        INT2FIX(0));
    
  •    ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
    
  •    ADD_INSNL(ret, nd_line(node), branchif, label_hit);
    
  • }
    narg = narg->nd_next;
    }
    if (resq->nd_args == 0) {

e$B$J$+$@$G$9!#e(B

At Wed, 9 Apr 2008 19:20:37 +0900,
wanabe wrote in [ruby-dev:34272]:

[ruby-core:14537]e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B
rescue e$B$N0z?t$KG[Ns$NE83+$r5v$9$h$&$K$7$^$7$?!#e(B

[ruby-core:14537]e$B$de(B rescue Interrupt, *x
e$B$N$h$&$JNc$J$i$=$l$G$$e(B
e$B$$$s$G$9$,!"e(B rescue *x, Interrupt
e$B$h$&$JNc$G$O$&$^$/$$$-$^$;$s!#e(B

e$B%o%J%Y$G$9!#e(B

08/04/10 e$B$Ke(B Nobuyoshi N.[email protected]
e$B$5$s$O=q$-$^$7$?e(B:

[ruby-core:14537]e$B$de(B rescue Interrupt, *x e$B$N$h$&$JNc$J$i$=$l$G$$e(B
e$B$$$s$G$9$,!"e(B rescue *x, Interrupt e$B$h$&$JNc$G$O$&$^$/$$$-$^$;$s!#e(B

e$B$J$k$[$I!"e(BNODE_ARGSPUSH e$B$,2?$J$N$+$d$C$H$o$+$j$^$7$?!#e(B
e$BF1MM$N<0$re(B casee$B!Ae(Bwhen
e$BJ8$G;n$7$?$H$3$m>e<j$/$$$+$J$+$C$?$N$Ge(B
e$B$=$A$i$bJ;$;$F%Q%C%A$K$7$F$_$^$7$?!#e(B

Index: compile.c

— compile.c (revision 15984)
+++ compile.c (working copy)
@@ -2747,18 +2747,11 @@
else if (nd_type(vals) == NODE_SPLAT ||
nd_type(vals) == NODE_ARGSCAT ||
nd_type(vals) == NODE_ARGSPUSH) {

  •    NODE *val = vals->nd_head;
       special_literals = 0;
    
  •    if (nd_type(vals) == NODE_ARGSCAT ||
    
  •  nd_type(vals) == NODE_ARGSPUSH) {
    
  •  when_vals(iseq, cond_seq, vals->nd_head, l1, 0);
    
  •  val = vals->nd_body;
    
  •    }
    
  •    COMPILE(cond_seq, "when/cond splat", val);
    
  •    ADD_INSN1(cond_seq, nd_line(val), checkincludearray, Qtrue);
    
  •    ADD_INSNL(cond_seq, nd_line(val), branchif, l1);
    
  •    COMPILE(cond_seq, "when/cond splat", vals);
    
  •    ADD_INSN1(cond_seq, nd_line(vals), checkincludearray, Qtrue);
    
  •    ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
    

    }
    else {
    rb_bug(“NODE_CASE: unknown node (%s)”,
    @@ -3212,15 +3205,33 @@
    label_hit = NEW_LABEL(nd_line(node));

     narg = resq->nd_args;
    
  •  while (narg) {
    
  • COMPILE(ret, “rescue arg”, narg->nd_head);
  • ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),
  •    INT2FIX(0));
    
  • ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
  • ADD_INSNL(ret, nd_line(node), branchif, label_hit);
  • narg = narg->nd_next;
  •  if (narg) {
    
  • if (nd_type(narg) == NODE_ARRAY) {
  •    while (narg) {
    
  •  COMPILE(ret, "rescue arg", narg->nd_head);
    
  •  ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),
    
  •      INT2FIX(0));
    
  •  ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
    
  •  ADD_INSNL(ret, nd_line(node), branchif, label_hit);
    
  •  narg = narg->nd_next;
    
  •    }
    
  • }
  • else if (nd_type(narg) == NODE_SPLAT ||
  •   nd_type(narg) == NODE_ARGSCAT ||
    
  •   nd_type(narg) == NODE_ARGSPUSH) {
    
  •    ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),
    
  •        INT2FIX(0));
    
  •    COMPILE(ret, "rescue/cond splat", narg);
    
  •    ADD_INSN1(ret, nd_line(node), checkincludearray, Qtrue);
    
  •    ADD_INSN(ret, nd_line(node), swap);
    
  •    ADD_INSN(ret, nd_line(node), pop);
    
  •    ADD_INSNL(ret, nd_line(node), branchif, label_hit);
    
  • } else {
  •    rb_bug("NODE_RESBODY: unknown node (%s)",
    
  •     ruby_node_name(nd_type(narg)));
    
  • }
    }
  •  if (resq->nd_args == 0) {
    
  •  else {
    
    ADD_INSN1(ret, nd_line(node), putobject,
    rb_eStandardError);
    ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(1),

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34453] Re: patch for [ruby-core:14537]”
on Fri, 18 Apr 2008 18:15:39 +0900, Nobuyoshi N.
[email protected] writes:

|NODE_SPLAT,NODE_ARGSCAT,NODE_ARGSPUSHe$B$NJ,4t$,$"$A$3$A$K8=$l$F!“e(B
|e$B7k9=e(Bcompile.ce$B$,$a$s$I$/$5$$$3$H$K$J$C$F$$$k$N$G@0M}$7$?$$$H;W$$e(B
|e$B$D$D$J$+$J$+?J$^$J$$>uBV$J$N$G!”$=$l$O$=$l$H$7$F$3$N%Q%C%A$O<h$je(B
|e$B9~$s$@$[$&$,$$$$$+$bCN$l$^$;$s$M!#e(B

e$B$8$c$“!”$J$+$@$5$s$,%3%%C%H$7$F$/$@$5$$!#%o%J%Y$5$s$K$b%3%%Ce(B
e$B%H8"$r$5$7$"$2$?J}$,$h$$$+$b$7$l$^$;$s!#e(B

e$B$J$+$@$G$9!#e(B

At Wed, 16 Apr 2008 20:47:24 +0900,
wanabe wrote in [ruby-dev:34429]:

[ruby-core:14537]e$B$de(B rescue Interrupt, *x e$B$N$h$&$JNc$J$i$=$l$G$$e(B
e$B$$$s$G$9$,!"e(B rescue *x, Interrupt e$B$h$&$JNc$G$O$&$^$/$$$-$^$;$s!#e(B

e$B$J$k$[$I!"e(BNODE_ARGSPUSH e$B$,2?$J$N$+$d$C$H$o$+$j$^$7$?!#e(B
e$BF1MM$N<0$re(B casee$B!Ae(Bwhen e$BJ8$G;n$7$?$H$3$m>e<j$/$$$+$J$+$C$?$N$Ge(B
e$B$=$A$i$bJ;$;$F%Q%C%A$K$7$F$_$^$7$?!#e(B

NODE_SPLAT,NODE_ARGSCAT,NODE_ARGSPUSHe$B$NJ,4t$,$"$A$3$A$K8=$l$F!“e(B
e$B7k9=e(Bcompile.ce$B$,$a$s$I$/$5$$$3$H$K$J$C$F$$$k$N$G@0M}$7$?$$$H;W$$e(B
e$B$D$D$J$+$J$+?J$^$J$$>uBV$J$N$G!”$=$l$O$=$l$H$7$F$3$N%Q%C%A$O<h$je(B
e$B9~$s$@$[$&$,$$$$$+$bCN$l$^$;$s$M!#e(B