In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c96f4d3199da99e66c9172234f7dd6ff18ea8456?hp=88af3b939957082fabb95c8d884bc32149f871cd>

- Log -----------------------------------------------------------------
commit c96f4d3199da99e66c9172234f7dd6ff18ea8456
Author: Father Chrysostomos <[email protected]>
Date:   Mon Dec 23 22:11:16 2013 -0800

    op.c: newLOOPOP: Remove code supporting do-sub

M       op.c

commit 8a6c0fcb27512d17f0e5121f3c83d1a1a72c6f6b
Author: Father Chrysostomos <[email protected]>
Date:   Mon Dec 23 22:08:26 2013 -0800

    pp_sys.c: Remove redundant null checks
    
    Nulls only get pushed on to the stack when pp_coreargs uses them to
    represent missing optional arguments.  Ops that take * prototypes
    will have had their arguments passed through rv2gv first, so they
    should always be GVs.  GvIOn never returns null.  When given a GV
    argument, it creates a new IO entry and returns that.  When given
    any other argument it croaks.
    
    Thank you to Daniel Dragan for providing a list of candidate pp
    functions in <[email protected]>
    (ticket #120842).

M       pp_sys.c
-----------------------------------------------------------------------

Summary of changes:
 op.c     |  2 +-
 pp_sys.c | 40 ++++++++++++++--------------------------
 2 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/op.c b/op.c
index f411009..0426e87 100644
--- a/op.c
+++ b/op.c
@@ -6458,7 +6458,7 @@ Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP *expr, 
OP *block)
     OP* listop;
     OP* o;
     const bool once = block && block->op_flags & OPf_SPECIAL &&
-      (block->op_type == OP_ENTERSUB || block->op_type == OP_NULL);
+                     block->op_type == OP_NULL;
 
     PERL_UNUSED_ARG(debuggable);
 
diff --git a/pp_sys.c b/pp_sys.c
index 49122e6..1ae1119 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -683,11 +683,8 @@ PP(pp_pipe_op)
     GV * const wgv = MUTABLE_GV(POPs);
     GV * const rgv = MUTABLE_GV(POPs);
 
-    if (!rgv || !wgv)
-       goto badexit;
-
-    if (!isGV_with_GP(rgv) || !isGV_with_GP(wgv))
-       DIE(aTHX_ PL_no_usym, "filehandle");
+    assert (isGV_with_GP(rgv));
+    assert (isGV_with_GP(wgv));
     rstio = GvIOn(rgv);
     wstio = GvIOn(wgv);
 
@@ -2269,11 +2266,11 @@ PP(pp_ioctl)
     const unsigned int func = POPu;
     const int optype = PL_op->op_type;
     GV * const gv = MUTABLE_GV(POPs);
-    IO * const io = gv ? GvIOn(gv) : NULL;
+    IO * const io = GvIOn(gv);
     char *s;
     IV retval;
 
-    if (!io || !argsv || !IoIFP(io)) {
+    if (!IoIFP(io)) {
        report_evil_fh(gv);
        SETERRNO(EBADF,RMS_IFI);        /* well, sort of... */
        RETPUSHUNDEF;
@@ -2468,7 +2465,7 @@ PP(pp_bind)
     STRLEN len;
     int op_type;
 
-    if (!io || !IoIFP(io))
+    if (!IoIFP(io))
        goto nuts;
 
     addr = SvPV_const(addrsv, len);
@@ -2493,9 +2490,9 @@ PP(pp_listen)
     dVAR; dSP;
     const int backlog = POPi;
     GV * const gv = MUTABLE_GV(POPs);
-    IO * const io = gv ? GvIOn(gv) : NULL;
+    IO * const io = GvIOn(gv);
 
-    if (!io || !IoIFP(io))
+    if (!IoIFP(io))
        goto nuts;
 
     if (PerlSock_listen(PerlIO_fileno(IoIFP(io)), backlog) >= 0)
@@ -2513,7 +2510,6 @@ PP(pp_accept)
 {
     dVAR; dSP; dTARGET;
     IO *nstio;
-    IO *gstio;
     char namebuf[MAXPATHLEN];
 #if (defined(VMS_DO_SOCKETS) && defined(DECCRTL_SOCKETS)) || 
defined(__QNXNTO__)
     Sock_size_t len = sizeof (struct sockaddr_in);
@@ -2524,12 +2520,7 @@ PP(pp_accept)
     GV * const ngv = MUTABLE_GV(POPs);
     int fd;
 
-    if (!ngv)
-       goto badexit;
-    if (!ggv)
-       goto nuts;
-
-    gstio = GvIO(ggv);
+    IO * const gstio = GvIO(ggv);
     if (!gstio || !IoIFP(gstio))
        goto nuts;
 
@@ -2586,7 +2577,7 @@ PP(pp_shutdown)
     GV * const gv = MUTABLE_GV(POPs);
     IO * const io = GvIOn(gv);
 
-    if (!io || !IoIFP(io))
+    if (!IoIFP(io))
        goto nuts;
 
     PUSHi( PerlSock_shutdown(PerlIO_fileno(IoIFP(io)), how) >= 0 );
@@ -3789,9 +3780,6 @@ PP(pp_open_dir)
     GV * const gv = MUTABLE_GV(POPs);
     IO * const io = GvIOn(gv);
 
-    if (!io)
-       goto nope;
-
     if ((IoIFP(io) || IoOFP(io)))
        Perl_ck_warner_d(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED),
                         "Opening filehandle %"HEKf" also as a directory",
@@ -3828,7 +3816,7 @@ PP(pp_readdir)
     const Direntry_t *dp;
     IO * const io = GvIOn(gv);
 
-    if (!io || !IoDIRP(io)) {
+    if (!IoDIRP(io)) {
        Perl_ck_warner(aTHX_ packWARN(WARN_IO),
                       "readdir() attempted on invalid dirhandle %"HEKf,
                             HEKfARG(GvENAME_HEK(gv)));
@@ -3878,7 +3866,7 @@ PP(pp_telldir)
     GV * const gv = MUTABLE_GV(POPs);
     IO * const io = GvIOn(gv);
 
-    if (!io || !IoDIRP(io)) {
+    if (!IoDIRP(io)) {
        Perl_ck_warner(aTHX_ packWARN(WARN_IO),
                       "telldir() attempted on invalid dirhandle %"HEKf,
                             HEKfARG(GvENAME_HEK(gv)));
@@ -3904,7 +3892,7 @@ PP(pp_seekdir)
     GV * const gv = MUTABLE_GV(POPs);
     IO * const io = GvIOn(gv);
 
-    if (!io || !IoDIRP(io)) {
+    if (!IoDIRP(io)) {
        Perl_ck_warner(aTHX_ packWARN(WARN_IO),
                       "seekdir() attempted on invalid dirhandle %"HEKf,
                                 HEKfARG(GvENAME_HEK(gv)));
@@ -3929,7 +3917,7 @@ PP(pp_rewinddir)
     GV * const gv = MUTABLE_GV(POPs);
     IO * const io = GvIOn(gv);
 
-    if (!io || !IoDIRP(io)) {
+    if (!IoDIRP(io)) {
        Perl_ck_warner(aTHX_ packWARN(WARN_IO),
                       "rewinddir() attempted on invalid dirhandle %"HEKf,
                                 HEKfARG(GvENAME_HEK(gv)));
@@ -3953,7 +3941,7 @@ PP(pp_closedir)
     GV * const gv = MUTABLE_GV(POPs);
     IO * const io = GvIOn(gv);
 
-    if (!io || !IoDIRP(io)) {
+    if (!IoDIRP(io)) {
        Perl_ck_warner(aTHX_ packWARN(WARN_IO),
                       "closedir() attempted on invalid dirhandle %"HEKf,
                                 HEKfARG(GvENAME_HEK(gv)));

--
Perl5 Master Repository

Reply via email to