sv_grow has long been permitted on read-only scalars. This stopped
being the case all the time when
9a0a85075 and
1620522e4 allowed read-
nly copy-on-write scalars. Because sv_force_normal has multiple
uses, sv_grow ended up croaking on *these* read-only scalars, but
not others.
This commit makes things consistent with the way they used to be.
=cut
*/
+static void S_sv_uncow(pTHX_ SV * const sv, const U32 flags);
+
char *
Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
{
}
else
{
- if (SvIsCOW(sv)) sv_force_normal(sv);
+ if (SvIsCOW(sv)) S_sv_uncow(aTHX_ sv, 0);
s = SvPVX_mutable(sv);
}
*/
-static void S_sv_uncow(pTHX_ SV * const sv, const U32 flags);
-
STRLEN
Perl_sv_utf8_upgrade_flags_grow(pTHX_ SV *const sv, const I32 flags, STRLEN extra)
{