Add missing syms to global.sym; update magic doc
[p5sagit/p5-mst-13.2.git] / gv.c
diff --git a/gv.c b/gv.c
index 8db44b4..6dd8ad0 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -144,10 +144,12 @@ I32 level;
        gv_init(topgv, stash, name, len, TRUE);
 
     if (cv = GvCV(topgv)) {
-       if (CvXSUB(cv) || CvROOT(cv)) { /* Not undefed. */
-           if (!GvCVGEN(topgv) ||      /* not an inheritance cache */
-               GvCVGEN(topgv) >= sub_generation) /* valid inh. cache */
+       if (CvXSUB(cv) || CvROOT(cv) || CvGV(cv)) { /* Not deleted, possibly autoloaded. */
+           if (GvCVGEN(topgv) >= sub_generation)
+               return topgv;   /* valid cached inheritance */
+           if (!GvCVGEN(topgv)) {      /* not an inheritance cache */
                return topgv;
+           }
        }
        /* stale cached entry, just junk it */
        SvREFCNT_dec(cv);