diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-21 00:44:18 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-21 00:44:18 +0000 |
commit | 23ea96f4290a37a6a5e64aef27d2c662c30a0fdf (patch) | |
tree | 61c7d30e17f0a7ee54ca103fc5951a58f1585af0 /pp_hot.c | |
parent | 40f2e8868acbefb2cc9abf76e6f5b95d85c8d8b6 (diff) | |
download | perl-23ea96f4290a37a6a5e64aef27d2c662c30a0fdf.tar.gz |
Fix for ID 20001020.006, concatenating an unset submatch
with utf8 resulted in "Modification of a read-only value".
p4raw-id: //depot/perl@7383
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -172,8 +172,14 @@ PP(pp_concat) /* Take a copy since we're about to overwrite TARG */ olds = s = (U8*)savepvn((char*)s, len); } - if (!SvOK(left) && SvTYPE(left) <= SVt_PVMG) - sv_setpv(left, ""); /* Suppress warning. */ + if (!SvOK(left) && SvTYPE(left) <= SVt_PVMG) { + if (SvREADONLY(left)) { + left = sv_2mortal(newSVpvn("", 0)); + left_utf = FALSE; + } + else + sv_setpv(left, ""); /* Suppress warning. */ + } l = (U8*)SvPV(left, targlen); left_utf |= DO_UTF8(left); if (TARG != left) |