diff options
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -3149,6 +3149,21 @@ PP(pp_pack) packlist(cat, pat, patend, MARK, SP + 1); + if (SvUTF8(cat)) { + STRLEN result_len; + const char * result = SvPV_nomg(cat, result_len); + const U8 * error_pos; + + if (! is_utf8_string_loc((U8 *) result, result_len, &error_pos)) { + _force_out_malformed_utf8_message(error_pos, + (U8 *) result + result_len, + 0, /* no flags */ + 1 /* Die */ + ); + NOT_REACHED; /* NOTREACHED */ + } + } + SvSETMAGIC(cat); SP = ORIGMARK; PUSHs(cat); |