This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
remove redundant croak code in pp_leavesublv
authorDavid Mitchell <davem@iabyn.com>
Thu, 15 Oct 2015 15:03:34 +0000 (16:03 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:44 +0000 (08:59 +0000)
Just before a code path that croaks, it does a POPSUB etc.
Since this will be done by the unwind following the croak anyway, it's
redundant.

pp_ctl.c

index 13205fe..23f6cce 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2336,10 +2336,6 @@ PP(pp_leavesublv)
                what = "undef";
            }
           croak:
-            CX_LEAVE_SCOPE(cx);
-           POPSUB(cx);
-           cxstack_ix--;
-           PL_curpm = cx->blk_oldpm;
            Perl_croak(aTHX_
                      "Can't return %s from lvalue subroutine", what
            );