This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] eof() coredumps when ARGV is aliased to another filehandle
[perl5.git] / pp_sys.c
index 4b1a1e7..e7e4121 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1894,7 +1894,7 @@ PP(pp_eof)
     if (MAXARG == 0) {
        if (PL_op->op_flags & OPf_SPECIAL) {    /* eof() */
            IO *io;
-           gv = PL_last_in_gv = PL_argvgv;
+           gv = PL_last_in_gv = GvEGV(PL_argvgv);
            io = GvIO(gv);
            if (io && !IoIFP(io)) {
                if ((IoFLAGS(io) & IOf_START) && av_len(GvAVn(gv)) < 0) {