This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #125541] Fix crash with %::=(); J->${\"::"}
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 821a383..651a7aa 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1411,7 +1411,7 @@ S_gv_stashpvn_internal(pTHX_ const char *name, U32 namelen, I32 flags)
     tmpgv = gv_fetchpvn_flags(tmpbuf, tmplen, flags, SVt_PVHV);
     if (tmpbuf != smallbuf)
        Safefree(tmpbuf);
-    if (!tmpgv)
+    if (!tmpgv || !isGV_with_GP(tmpgv))
        return NULL;
     stash = GvHV(tmpgv);
     if (!(flags & ~GV_NOADD_MASK) && !stash) return NULL;