A GVs stash can be NULL, so don't call macros that assume otherwise
Nicholas Clark [Thu, 29 Dec 2005 00:19:01 +0000 (00:19 +0000)]
without checking.

p4raw-id: //depot/perl@26518

pp.c

diff --git a/pp.c b/pp.c
index 2e9234b..d679f6a 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -598,7 +598,8 @@ PP(pp_gelem)
            break;
        case 'P':
            if (strEQ(second_letter, "ACKAGE")) {
-               const HEK * const hek = HvNAME_HEK(GvSTASH(gv));
+               const HV * const stash = GvSTASH(gv);
+               const HEK * const hek = stash ? HvNAME_HEK(stash) : NULL;
                sv = hek ? newSVhek(hek) : newSVpvn("__ANON__", 8);
            }
            break;