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
[perl5.git] / 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);