This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix UV_SIZEOF to UVSIZE; change the overflow tests
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 9fcf55b..ae76f82 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -677,6 +677,10 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
            }
        }
        break;
+    case 'V':
+       if (strEQ(name, "VERSION"))
+           GvMULTI_on(gv);
+       break;
 
     case '&':
        if (len > 1)
@@ -718,7 +722,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
            break;
        if (sv_type > SVt_PV && PL_curcop != &PL_compiling) {
            HV* stash = gv_stashpvn("Errno",5,FALSE);
-           if(!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
+           if (!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
                dSP;
                PUTBACK;
                require_pv("Errno.pm");
@@ -757,7 +761,6 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     case '/':
     case '|':
     case '\001':
-    case '\002':
     case '\003':
     case '\004':
     case '\005':
@@ -767,7 +770,6 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     case '\017':
     case '\020':
     case '\024':
-    case '\027':
        if (len > 1)
            break;
        goto magicalize;
@@ -775,6 +777,10 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
        if (len > 1)
            break;
        goto ro_magicalize;
+    case '\027':       /* $^W & $^Warnings */
+       if (len > 1 && strNE(name, "\027arnings"))
+           break;
+       goto magicalize;
 
     case '+':
        if (len > 1)
@@ -947,14 +953,16 @@ Perl_gp_ref(pTHX_ GP *gp)
 void
 Perl_gp_free(pTHX_ GV *gv)
 {
+    dTHR;  
     GP* gp;
     CV* cv;
-    dTHR;  
 
     if (!gv || !(gp = GvGP(gv)))
        return;
-    if (gp->gp_refcnt == 0 && ckWARN_d(WARN_INTERNAL)) {
-        Perl_warner(aTHX_ WARN_INTERNAL, "Attempt to free unreferenced glob pointers");
+    if (gp->gp_refcnt == 0) {
+       if (ckWARN_d(WARN_INTERNAL))
+           Perl_warner(aTHX_ WARN_INTERNAL,
+                       "Attempt to free unreferenced glob pointers");
         return;
     }
     if (gp->gp_cv) {