This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_sys.c: More null check removal
authorFather Chrysostomos <sprout@cpan.org>
Tue, 24 Dec 2013 13:44:01 +0000 (05:44 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 24 Dec 2013 16:19:54 +0000 (08:19 -0800)
Thanks again to Daniel Dragan for pointing out candidates in
<rt-4.0.18-29603-1387872667-551.120842-15-0@perl.org> (ticket #120842).

pp_sys.c

index 1ae1119..08aead7 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2371,15 +2371,9 @@ PP(pp_socket)
     const int type = POPi;
     const int domain = POPi;
     GV * const gv = MUTABLE_GV(POPs);
-    IO * const io = gv ? GvIOn(gv) : NULL;
+    IO * const io = GvIOn(gv);
     int fd;
 
-    if (!io) {
-       report_evil_fh(gv);
-       SETERRNO(EBADF,LIB_INVARG);
-       RETPUSHUNDEF;
-    }
-
     if (IoIFP(io))
        do_close(gv, FALSE);