This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
For s///r, don't call SvPV_force() on the original value. Resolves #97954.
authorNicholas Clark <nick@ccl4.org>
Mon, 29 Aug 2011 13:25:23 +0000 (15:25 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 29 Aug 2011 14:01:38 +0000 (16:01 +0200)
commit0c1438a1f54e0a813029e14b554e904c360b046a
tree4f9b8763d4792c0d34f9fc52c11d06c2cdcd207d
parentb1e878f6dbf2d7092691a3ba0fc5d369ae48aa8c
For s///r, don't call SvPV_force() on the original value. Resolves #97954.

8ca8a454f60a417f optimised the implementation of s///r by avoiding an
unconditional copy of the original value. However, it introduced a behaviour
regression where if original value happened to be one of a few particular
types, it could be modified by being forced to a string using SvPV_force().
The substitution was (correctly) performed on a copy of this string.
pp_hot.c
t/re/subst.t