summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2016-05-15 13:48:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-05-15 14:01:29 -0700
commit60a26c797bbff039ea7f861903732e7cceae415a (patch)
treeb586fd0b92cc555af544eb2b1f7fa56f1c99d38a /hv.c
parent59a14f30f688ba05fd58f9dba1521fb9be116403 (diff)
downloadperl-60a26c797bbff039ea7f861903732e7cceae415a.tar.gz
[perl #128086] Fix precedence in hv_ename_delete
A stash’s array of names may have null for the first entry, in which case it is not one of the effective names, and the name count will be negative. The ‘count > 0’ is meant to prevent hv_ename_delete from trying to read that entry, but a precedence problem introduced in 4643eb699 stopped it from doing that. [This commit message was written by the committer.]
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index 7b5ad95878..55234753ed 100644
--- a/hv.c
+++ b/hv.c
@@ -2476,9 +2476,10 @@ Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
return;
}
if (
- count > 0 && (HEK_UTF8(*namep) || (flags & SVf_UTF8))
+ count > 0 && ((HEK_UTF8(*namep) || (flags & SVf_UTF8))
? hek_eq_pvn_flags(aTHX_ *namep, name, (I32)len, flags)
: (HEK_LEN(*namep) == (I32)len && memEQ(HEK_KEY(*namep), name, len))
+ )
) {
aux->xhv_name_count = -count;
}