e$B1sF#$G$9!#e(B
NODE_WHEN e$B$K$bF1$8LdBj$,$"$j$^$7$?!#0J2<$Ne(B 2
e$B$D$N%W%m%0%i%`$O0l2sL$@$1e(B
[:foo, :bar] e$B$G$J$$$b$N$r=PNO$7$^$9!#e(B
f = true
case
when false
when true
while f
p [:foo, while true; break :bar; end]
redo
end
end
f = true
case
when true
while f
p [:foo, while true; break :bar; end]
redo
end
end
NODE_CASE e$B$K$bF1MM$NLdBj$,$"$j$^$9$,!"$=$l$>$l$Ne(B body
e$B$N:G=i$Ke(B pop e$B$,e(B
e$BA^F~$5$l$k$?$a!"GA$-7j:GE,2=$,F/$+$:!"H/>I$9$kNc$O8+$D$1$i$l$F$$$^$;$s!#e(B
e$B$G$b$9$4$/%P%0$N85$J$N$G!“0J2<$N%Q%C%A$G$Oe(B NODE_CASE
e$B$bBP=h$7$F$”$j$^$9!#e(B
Index: compile.c
— compile.c (revision 14785)
+++ compile.c (working copy)
@@ -2634,6 +2634,7 @@
ADD_LABEL(ret, then_label);
ADD_SEQ(ret, then_seq);
ADD_INSNL(ret, nd_line(node), jump, end_label);
-
if (!poped) ADD_INSN(ret, nd_line(node), pop);
ADD_LABEL(ret, else_label);
ADD_SEQ(ret, else_seq);
@@ -2680,6 +2681,7 @@
ADD_INSN(body_seq, nd_line(node), pop);
COMPILE_(body_seq, “when body”, node->nd_body, poped);
ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
-
if (!poped) ADD_INSN(body_seq, nd_line(node), pop);
vals = node->nd_head;
if (vals) {
@@ -2723,6 +2725,7 @@
ADD_INSN(cond_seq, nd_line(node), pop);
COMPILE_(cond_seq, “else”, node, poped);
ADD_INSNL(cond_seq, nd_line(node), jump, endlabel);
-
if (!poped) ADD_INSN(cond_seq, nd_line(node), pop);
}
else {
debugs("== else (implicit)\n");
@@ -2761,6 +2764,7 @@
ADD_LABEL(body_seq, l1);
COMPILE_(body_seq, “when”, node->nd_body, poped);
ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
-
if (!poped) ADD_INSN(body_seq, nd_line(node), pop);
vals = node->nd_head;
if (vals && nd_type(vals) == NODE_ARRAY) {
@@ -2803,6 +2807,7 @@
/* else */
COMPILE_(ret, “else”, node, poped);
ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
-
if (!poped) ADD_INSN(ret, nd_line(orig_node), pop);
ADD_SEQ(ret, body_seq);
ADD_LABEL(ret, endlabel);
e$B$D$$$G$G$9$,!"?tL>$NJ}$+$i%3%_%C%H8"8B$r;}$C$?$i$I$&$+$H8@$o$l$F$$$^$9!#e(B
e$B$h$1$l$P!"$*0l$D$/$@$5$$!#Js9p$7$?$b$N$re(B test_knownbug.rb
e$B$K>!<j$Ke(B
e$BDI2C$9$k$/$i$$$O$G$-$k$H;W$$$^$9!#e(B