summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-12-19 10:19:40 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-12-19 10:19:40 +0000
commita26e96dff1c9d91b0bf389e6149016d8a3f26e49 (patch)
treebfff3f71b58fdbf6c8d7dc9e3fcfafc677bf74f3 /hv.c
parent1915677f475bd66f40974d770bf0b769f8cd7025 (diff)
downloadperl-a26e96dff1c9d91b0bf389e6149016d8a3f26e49.tar.gz
Fix READONLY hashes:
1. Discovered need for disabled scope.c part of Jeff's patch. 2. Corrected hv_delete* - entry was being de-linked from chain (patch program not smart enough?) p4raw-id: //depot/perlio@13795
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hv.c b/hv.c
index 05f6deb649..d0859d82c7 100644
--- a/hv.c
+++ b/hv.c
@@ -768,9 +768,6 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags)
Perl_hv_notallowed(aTHX_ is_utf8, key, klen, keysave);
}
- *oentry = HeNEXT(entry);
- if (i && !*oentry)
- xhv->xhv_fill--; /* HvFILL(hv)-- */
if (flags & G_DISCARD)
sv = Nullsv;
else {
@@ -790,6 +787,9 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags)
* doesn't go down, but the number placeholders goes up */
xhv->xhv_placeholders++; /* HvPLACEHOLDERS(hv)++ */
} else {
+ *oentry = HeNEXT(entry);
+ if (i && !*oentry)
+ xhv->xhv_fill--; /* HvFILL(hv)-- */
if (entry == xhv->xhv_eiter /* HvEITER(hv) */)
HvLAZYDEL_on(hv);
else
@@ -911,9 +911,6 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
Perl_hv_notallowed(aTHX_ is_utf8, key, klen, keysave);
}
- *oentry = HeNEXT(entry);
- if (i && !*oentry)
- xhv->xhv_fill--; /* HvFILL(hv)-- */
if (flags & G_DISCARD)
sv = Nullsv;
else {
@@ -933,6 +930,9 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
* doesn't go down, but the number placeholders goes up */
xhv->xhv_placeholders++; /* HvPLACEHOLDERS(hv)++ */
} else {
+ *oentry = HeNEXT(entry);
+ if (i && !*oentry)
+ xhv->xhv_fill--; /* HvFILL(hv)-- */
if (entry == xhv->xhv_eiter /* HvEITER(hv) */)
HvLAZYDEL_on(hv);
else