This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
util.c:report_evil_fh: Rmv redundant isGV check
authorFather Chrysostomos <sprout@cpan.org>
Fri, 25 May 2012 05:19:29 +0000 (22:19 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 7 Jun 2012 15:18:51 +0000 (08:18 -0700)
Checking isGV_with_GP makes the isGV check redundant.  The only case
in which isGV could be true when isGV_with_GP is false could be a GV
playing PVBM, but those don’t exist any more.  When they did exist,
this check was probably wrong (and crashable).

util.c

diff --git a/util.c b/util.c
index c080dc0..5fbf9b2 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3751,7 +3751,7 @@ Perl_report_evil_fh(pTHX_ const GV *gv)
 
     if (ckWARN(warn_type)) {
         SV * const name
-            = gv && (isGV(gv) || isGV_with_GP(gv)) && GvENAMELEN(gv) ?
+            = gv && isGV_with_GP(gv) && GvENAMELEN(gv) ?
                                      sv_2mortal(newSVhek(GvENAME_HEK(gv))) : NULL;
        const char * const pars =
            (const char *)(OP_IS_FILETEST(op) ? "" : "()");