This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't SEGV when dumping an undefined typeglob. The HEK used to store
authorNicholas Clark <nick@ccl4.org>
Thu, 1 Mar 2007 16:09:31 +0000 (16:09 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 1 Mar 2007 16:09:31 +0000 (16:09 +0000)
the GV's name can be NULL.

p4raw-id: //depot/perl@30439

gv.h

diff --git a/gv.h b/gv.h
index cbc6840..61af704 100644 (file)
--- a/gv.h
+++ b/gv.h
@@ -113,7 +113,7 @@ Return the SV from the GV.
 
 #define GvLINE(gv)     (GvGP(gv)->gp_line)
 #define GvFILE_HEK(gv) (GvGP(gv)->gp_file_hek)
-#define GvFILE(gv)     HEK_KEY(GvFILE_HEK(gv))
+#define GvFILE(gv)     (GvFILE_HEK(gv) ? HEK_KEY(GvFILE_HEK(gv)) : NULL)
 #define GvFILEGV(gv)   (gv_fetchfile(GvFILE(gv)))
 
 #define GvEGV(gv)      (GvGP(gv)->gp_egv)