Break in lambda

lambda e$BD>2<$Ke(B break e$B$,$"$C$?$H$-!"$J$K$4$H$b$J$+$C$?$+$N$h$&e(B
e$B$K$=$3$rDL$j2a$.$k$N$OJQ$G$O$J$$$G$7$g$&$+!#e(B

statement not reached e$B$H$$$&7Y9p$b=P$^$9$7!#e(B

% ./ruby -ve ’
lambda {
p 1
break
p 2
}.call

ruby 1.9.0 (2008-05-11 revision 16355) [i686-linux]
-e:4: warning: statement not reached
1
2

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

2008/05/11 15:13 Tanaka A. [email protected]:

lambda e$BD>2<$Ke(B break e$B$,$“$C$?$H$-!”$J$K$4$H$b$J$+$C$?$+$N$h$&e(B
e$B$K$=$3$rDL$j2a$.$k$N$OJQ$G$O$J$$$G$7$g$&$+!#e(B

e$B<+?.$O$"$j$^$;$s$,!"B?J,$3$l$G$$$$$N$G$O$J$$$+$H;W$$$^$9!#e(B

Index: vm_insnhelper.c

— vm_insnhelper.c (revision 16344)
+++ vm_insnhelper.c (working copy)
@@ -1238,7 +1238,7 @@
if (VM_FRAME_TYPE(cfp) == FRAME_MAGIC_LAMBDA) {
/* lambda{… break …} */
is_orphan = 0;

  •    pt = dfp;
    
  •    pt = GC_GUARDED_PTR_REF((VALUE *) *dfp);
    
    }
    else {
    dfp = GC_GUARDED_PTR_REF((VALUE *) *dfp);

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

In message “Re: [ruby-dev:34658] Re: break in lambda”
on Mon, 12 May 2008 19:50:42 +0900, wanabe [email protected]
writes:

|2008/05/11 15:13 Tanaka A. [email protected]:
|> lambda e$BD>2<$Ke(B break e$B$,$“$C$?$H$-!”$J$K$4$H$b$J$+$C$?$+$N$h$&e(B
|> e$B$K$=$3$rDL$j2a$.$k$N$OJQ$G$O$J$$$G$7$g$&$+!#e(B
|
|e$B<+?.$O$"$j$^$;$s$,!"B?J,$3$l$G$$$$$N$G$O$J$$$+$H;W$$$^$9!#e(B

e$B$5$5$@$/$s$5$(NI$1$l$P%3%_%C%H$7$^$9!#e(B

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

In message “Re: [ruby-dev:34670] Re: break in lambda”
on Tue, 13 May 2008 11:45:09 +0900, SASADA Koichi [email protected]
writes:

|> e$B$5$5$@$/$s$5$(NI$1$l$P%3%_%C%H$7$^$9!#e(B
|
|e$B!!;d$b<+?.$,$"$j$^$;$s$,!$8!>Z$9$kM>M5$,$J$$$N$G$*G$$;$7$^$9!%%F%9%He(B
|e$B$ODL$C$F$$$k$s$G$9$h$M!)e(B

e$B$8$c$“!”%o%J%Y$5$s$K%3%_%C%H8"$,$H$I$$$?$i%A%'%C%/%$%s$7$F$$e(B
e$B$?$@$/$H$$$&$3$H$G!#e(B

|e$B!!3NG’$G$9$,!$e(Blambda e$BCf$Ne(B break e$B$O!$e(Breturn e$B$HF1Ey$G$$$$$s$G$7$?$C$1!%e(B

e$B$O$$!#e(B

e$B!!$5$5$@$G$9!%e(B

Yukihiro M. wrote:

e$B$8$c$"!"%o%J%Y$5$s$K%3%_%C%H8"$,$H$I$$$?$i%A%’%C%/%$%s$7$F$$e(B
e$B$?$@$/$H$$$&$3$H$G!#e(B

e$B!!$"$j$c!$$9$_$^$;$s!%$9$G$KFO$$$F$$$k$H;W$C$F$$$^$7$?!%e(B

|e$B!!3NG’$G$9$,!$e(Blambda e$BCf$Ne(B break e$B$O!$e(Breturn e$B$HF1Ey$G$$$$$s$G$7$?$C$1!%e(B

e$B$O$$!#e(B

e$B!!$3$N$"$?$j!$5nG/@0M}$7$?$O$:$J$N$K!$$^$@;D$C$F$$$k$H8@$&$3$H$O!$%Fe(B
e$B%9%H$,IT==J,$@$C$?$H$$$&$3$H$J$s$G$7$g$&$M!%$3$A$i$b$9$_$^$;$s!%:n$Ce(B
e$B$?8e$G!$B>$NJQ99$,1F6A$7$?$N$+$J!%e(B

e$B!!$5$5$@$G$9!%e(B

Yukihiro M. wrote:

|e$B<+?.$O$"$j$^$;$s$,!"B?J,$3$l$G$$$$$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