summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2013-09-11 16:30:43 +1000
committerTony Cook <tony@develop-help.com>2013-09-16 14:16:03 +1000
commit5f39160de676c8a884597fdd3044c993e6c42555 (patch)
tree216d53d80493a7bbc7d6f131abced97f20d3de1a /hv.h
parent791f8f9aa5a989a2ccf7f9fae40f68bf65f86f9b (diff)
downloadperl-5f39160de676c8a884597fdd3044c993e6c42555.tar.gz
[perl #79074] make sure HeSVKEY_force() preserves UTF8ness (pvn)
HeSVKEY_force() is only used in two places in core. In the first case, the key is always stored as a SV (when handling tie magic, since NEXTKEY can only return a SV) The second case is in B::HE, but I don't see a way to create a B::HE object from a hash.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/hv.h b/hv.h
index 920fd99760..fa13a84230 100644
--- a/hv.h
+++ b/hv.h
@@ -367,7 +367,9 @@ C<SV*>.
((HeKLEN(he) == HEf_SVKEY) ? \
HeKEY_sv(he) : \
newSVpvn_flags(HeKEY(he), \
- HeKLEN(he), SVs_TEMP)) : \
+ HeKLEN(he), \
+ SVs_TEMP | \
+ ( HeKUTF8(he) ? SVf_UTF8 : 0 ))) : \
&PL_sv_undef)
#define HeSVKEY_set(he,sv) ((HeKLEN(he) = HEf_SVKEY), (HeKEY_sv(he) = sv))