Skip to content

Commit

Permalink
[perl #128086] Fix precedence in hv_ename_delete
Browse files Browse the repository at this point in the history
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 4643eb6
stopped it from doing that.

[This commit message was written by the committer.]
  • Loading branch information
hvds authored and Father Chrysostomos committed May 15, 2016
1 parent 59a14f3 commit 60a26c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hv.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 60a26c7

Please sign in to comment.