Change 16277 by jhi@alpha on 2002/04/30 12:32:27

        Dodge a NULL pointer dereference in cleanup of Class::DBI
        0.86's t/04-lazy.t, caught by Tatsuhiko Miyagawa.

Affected files ...

.... //depot/perl/util.c#343 edit

Differences ...

==== //depot/perl/util.c#343 (text) ====
Index: perl/util.c
--- perl/util.c.~1~     Tue Apr 30 06:45:06 2002
+++ perl/util.c Tue Apr 30 06:45:06 2002
@@ -1109,13 +1109,15 @@
        if (CopLINE(cop))
            Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf,
            OutCopFILE(cop), (IV)CopLINE(cop));
-       if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
+       if (GvIO(PL_last_in_gv) && GvGP(PL_last_in_gv) &&
+           IoLINES(GvIOp(PL_last_in_gv))) {
            bool line_mode = (RsSIMPLE(PL_rs) &&
                              SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');
            Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,
-                     PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
-                     line_mode ? "line" : "chunk",
-                     (IV)IoLINES(GvIOp(PL_last_in_gv)));
+                          PL_last_in_gv == PL_argvgv ?
+                          "" : GvNAME(PL_last_in_gv),
+                          line_mode ? "line" : "chunk",
+                          (IV)IoLINES(GvIOp(PL_last_in_gv)));
        }
 #ifdef USE_5005THREADS
        if (thr->tid)
End of Patch.

Reply via email to