Skip another file in the VERSION comparison program
[p5sagit/p5-mst-13.2.git] / hv.c
diff --git a/hv.c b/hv.c
index 6d33966..c394e73 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1094,7 +1094,7 @@ S_hsplit(pTHX_ HV *hv)
       return;
     }
     if (SvOOK(hv)) {
-       Copy(&a[oldsize * sizeof(HE*)], &a[newsize * sizeof(HE*)], 1, struct xpvhv_aux);
+       Move(&a[oldsize * sizeof(HE*)], &a[newsize * sizeof(HE*)], 1, struct xpvhv_aux);
     }
 #else
     Newx(a, PERL_HV_ARRAY_ALLOC_BYTES(newsize)
@@ -1985,6 +1985,7 @@ Perl_hv_kill_backrefs(pTHX_ HV *hv) {
     if (av) {
        HvAUX(hv)->xhv_backreferences = 0;
        Perl_sv_kill_backrefs(aTHX_ (SV*) hv, av);
+       SvREFCNT_dec(av);
     }
 }
 
@@ -2686,49 +2687,53 @@ Perl_refcounted_he_fetch(pTHX_ const struct refcounted_he *chain, SV *keysv,
     /* Just to be awkward, if you're using this interface the UTF-8-or-not-ness
        of your key has to exactly match that which is stored.  */
     SV *value = &PL_sv_placeholder;
-    bool is_utf8;
 
-    if (keysv) {
-       if (flags & HVhek_FREEKEY)
-           Safefree(key);
-       key = SvPV_const(keysv, klen);
-       flags = 0;
-       is_utf8 = (SvUTF8(keysv) != 0);
-    } else {
-       is_utf8 = ((flags & HVhek_UTF8) ? TRUE : FALSE);
-    }
+    if (chain) {
+       /* No point in doing any of this if there's nothing to find.  */
+       bool is_utf8;
 
-    if (!hash) {
-       if (keysv && (SvIsCOW_shared_hash(keysv))) {
-            hash = SvSHARED_HASH(keysv);
-        } else {
-            PERL_HASH(hash, key, klen);
-        }
-    }
+       if (keysv) {
+           if (flags & HVhek_FREEKEY)
+               Safefree(key);
+           key = SvPV_const(keysv, klen);
+           flags = 0;
+           is_utf8 = (SvUTF8(keysv) != 0);
+       } else {
+           is_utf8 = ((flags & HVhek_UTF8) ? TRUE : FALSE);
+       }
 
-    for (; chain; chain = chain->refcounted_he_next) {
+       if (!hash) {
+           if (keysv && (SvIsCOW_shared_hash(keysv))) {
+               hash = SvSHARED_HASH(keysv);
+           } else {
+               PERL_HASH(hash, key, klen);
+           }
+       }
+
+       for (; chain; chain = chain->refcounted_he_next) {
 #ifdef USE_ITHREADS
-       if (hash != chain->refcounted_he_hash)
-           continue;
-       if (klen != chain->refcounted_he_keylen)
-           continue;
-       if (memNE(REF_HE_KEY(chain),key,klen))
-           continue;
-       if (!!is_utf8 != !!(chain->refcounted_he_data[0] & HVhek_UTF8))
-           continue;
+           if (hash != chain->refcounted_he_hash)
+               continue;
+           if (klen != chain->refcounted_he_keylen)
+               continue;
+           if (memNE(REF_HE_KEY(chain),key,klen))
+               continue;
+           if (!!is_utf8 != !!(chain->refcounted_he_data[0] & HVhek_UTF8))
+               continue;
 #else
-       if (hash != HEK_HASH(chain->refcounted_he_hek))
-           continue;
-       if (klen != (STRLEN)HEK_LEN(chain->refcounted_he_hek))
-           continue;
-       if (memNE(HEK_KEY(chain->refcounted_he_hek),key,klen))
-           continue;
-       if (!!is_utf8 != !!HEK_UTF8(chain->refcounted_he_hek))
-           continue;
+           if (hash != HEK_HASH(chain->refcounted_he_hek))
+               continue;
+           if (klen != (STRLEN)HEK_LEN(chain->refcounted_he_hek))
+               continue;
+           if (memNE(HEK_KEY(chain->refcounted_he_hek),key,klen))
+               continue;
+           if (!!is_utf8 != !!HEK_UTF8(chain->refcounted_he_hek))
+               continue;
 #endif
 
-       value = sv_2mortal(refcounted_he_value(chain));
-       break;
+           value = sv_2mortal(refcounted_he_value(chain));
+           break;
+       }
     }
 
     if (flags & HVhek_FREEKEY)
@@ -2925,6 +2930,8 @@ Perl_fetch_cop_label(pTHX_ struct refcounted_he *const chain, STRLEN *len,
 struct refcounted_he *
 Perl_store_cop_label(pTHX_ struct refcounted_he *const chain, const char *label)
 {
+    PERL_ARGS_ASSERT_STORE_COP_LABEL;
+
     return refcounted_he_new_common(chain, ":", 1, HVrhek_PV, HVrhek_PV,
                                    label, strlen(label));
 }