This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for smartmatch reversion
[perl5.git] / pp_ctl.c
index bde8d29..e6d39f2 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3092,6 +3092,8 @@ PP(pp_goto)
            for (; enterops[ix]; ix++) {
                PL_op = enterops[ix];
                S_check_op_type(aTHX_ PL_op);
+               DEBUG_l( Perl_deb(aTHX_ "pp_goto: Entering %s\n",
+                                        OP_NAME(PL_op)));
                PL_op->op_ppaddr(aTHX);
            }
            PL_op = oldop;
@@ -5187,8 +5189,11 @@ PP(pp_enterwhen)
        to the op that follows the leavewhen.
        RETURNOP calls PUTBACK which restores the stack pointer after the POPs.
     */
-    if (!(PL_op->op_flags & OPf_SPECIAL) && !SvTRUEx(POPs))
+    if (!(PL_op->op_flags & OPf_SPECIAL) && !SvTRUEx(POPs)) {
+       if (gimme == G_SCALAR)
+           PUSHs(&PL_sv_undef);
        RETURNOP(cLOGOP->op_other->op_next);
+    }
 
     cx = cx_pushblock(CXt_WHEN, gimme, SP, PL_savestack_ix);
     cx_pushwhen(cx);