Message-ID: <
20010314015251.B16112@puffinry.freeserve.co.uk>
Fix for 2000313.004.
p4raw-id: //depot/perl@9140
cx = &cxstack[ix];
switch (CxTYPE(cx)) {
case CXt_EVAL:
- gotoprobe = PL_eval_root; /* XXX not good for nested eval */
- break;
+ if (CxREALEVAL(cx)) {
+ gotoprobe = PL_eval_root; /* XXX not good for nested eval */
+ break;
+ }
+ /* else fall through */
case CXt_LOOP:
gotoprobe = cx->blk_oldcop->op_sibling;
break;
push_return(cLOGOP->op_other->op_next);
PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), SP);
PUSHEVAL(cx, 0, 0);
- PL_eval_root = PL_op; /* Only needed so that goto works right. */
PL_in_eval = EVAL_INEVAL;
sv_setpv(ERRSV,"");
# "This IS structured code. It's just randomly structured."
-print "1..19\n";
+print "1..21\n";
while ($?) {
$foo = 1;
goto FORL2;
}
+# Does goto work correctly within a try block?
+# (BUG ID 20000313.004)
+
+my $ok = 0;
+eval {
+ my $variable = 1;
+ goto LABEL20;
+ LABEL20: $ok = 1 if $variable;
+};
+print ($ok&&!$@ ? "ok 20\n" : "not ok 20\n");
+
+# And within an eval-string?
+
+
+$ok = 0;
+eval q{
+ my $variable = 1;
+ goto LABEL21;
+ LABEL21: $ok = 1 if $variable;
+};
+print ($ok&&!$@ ? "ok 21\n" : "not ok 21\n");
+
+
exit;
bypass: