summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-05-25 21:19:38 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-05-25 21:19:38 +0000
commit97fcbf9696d4cdc3d47f383b99d9840ccb39c616 (patch)
treedb7f5a92355aa3402f174a0065ca2542147c15ee /pp.c
parentae77835f9b08444f73b593d4cdc0758132dbbf00 (diff)
downloadperl-97fcbf9696d4cdc3d47f383b99d9840ccb39c616.tar.gz
Fix up integration 5.003->5.004.
p4raw-id: //depot/perl@19
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 6e8e4c1dcd..af615c3385 100644
--- a/pp.c
+++ b/pp.c
@@ -2131,8 +2131,9 @@ PP(pp_delete)
if (op->op_private & OPpSLICE) {
dMARK; dORIGMARK;
+ U32 hvtype;
hv = (HV*)POPs;
- U32 hvtype = SvTYPE(hv);
+ hvtype = SvTYPE(hv);
while (++MARK <= SP) {
if (hvtype == SVt_PVHV)
sv = hv_delete_ent(hv, *MARK, discard, 0);
@@ -2153,9 +2154,12 @@ PP(pp_delete)
else {
SV *keysv = POPs;
hv = (HV*)POPs;
- if (SvTYPE(hv) != SVt_PVHV)
+ if (SvTYPE(hv) == SVt_PVHV)
+ sv = hv_delete_ent(hv, keysv, discard, 0);
+ else if (SvTYPE(hv) == SVt_PVAV)
+ sv = avhv_delete_ent((AV*)hv, keysv, discard, 0);
+ else
DIE("Not a HASH reference");
- sv = hv_delete_ent(hv, keysv, discard, 0);
if (!sv)
sv = &sv_undef;
if (!discard)
@@ -2197,7 +2201,7 @@ PP(pp_hslice)
he = hv_fetch_ent(hv, keysv, lval, 0);
svp = he ? &HeVAL(he) : 0;
} else {
- svp = avhv_fetch_ent((AV*)hv, keysv, lval);
+ svp = avhv_fetch_ent((AV*)hv, keysv, lval, 0);
}
if (lval) {
if (!he || HeVAL(he) == &sv_undef)