This is something that
78b79c7758 missed.
When xhv_name is a HEK *, it is both the regular name and the effect-
ive name at the same time. Only when xhv_name_count is negative is the
regular name not also the effective name.
hv_ename_delete needs to take the HEK that xhv_name points to and
put it in a new HEK * array in xhv_name. This array will just have
one element.
When xhv_name_count is negative, effective names start with the second
element. So we set xhv_name_count to -1 so there isn’t one.
HEK_LEN(aux->xhv_name) == (I32)len
&& memEQ(HEK_KEY(aux->xhv_name), name, len)
) {
- unshare_hek_or_pvn(aux->xhv_name, 0, 0, 0);
- aux->xhv_name = NULL;
+ const HEK * const namehek = aux->xhv_name;
+ Newxc(aux->xhv_name, 1, HEK *, HEK);
+ *(const HEK **)aux->xhv_name = namehek;
+ aux->xhv_name_count = -1;
}
}