Commit 3079bec420 for perl
commit 3079bec420e01ff818fc576e8e955aba1726fd19
Author: Tony Cook <tony@develop-help.com>
Date: Thu Oct 8 09:59:57 2026 +1100
unpack: handle returned utf8 message array correctly
utf8_to_uv_msgs() returned AV messages contains references to hashes,
not the hashes themselves.
diff --git a/pp_pack.c b/pp_pack.c
index 0cfed88386..17a543a68d 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -323,7 +323,10 @@ S_utf8_to_bytes(pTHX_ const char **s, const char *end, U8 *buf, SSize_t buf_len,
/* We have enough characters for the buffer. Did we have problems ? */
if (msgs) {
while (av_count(msgs) > 0) {
- HV * msg_hash = (HV *) av_shift(msgs);
+ SV * msg_rv = av_shift(msgs);
+ assert(SvROK(msg_rv));
+ assert(SvTYPE(SvRV(msg_rv)) == SVt_PVHV);
+ HV * msg_hash = (HV *)SvRV(msg_rv);
SV ** packed_categories_p = hv_fetchs(msg_hash, "warn_categories", 0);
if (packed_categories_p == NULL) {
continue;