Previously S_doparseform() was using SvPV_force(), because the pattern had to
be forced to a string, because the compiled format was stored in the string's
buffer. Now that the compiled format is stored in the magic struct, this isn't
necessary.
Additionally, removing the call to SvPV_force() removes the need to hack with
the SvREADONLY() flag in pp_formline.
}
if(!mg) {
- if (SvREADONLY(tmpForm)) {
- SvREADONLY_off(tmpForm);
- mg = doparseform(tmpForm);
- SvREADONLY_on(tmpForm);
- }
- else
- mg = doparseform(tmpForm);
+ mg = doparseform(tmpForm);
assert(mg);
}
fpc = (U32*)mg->mg_ptr;
S_doparseform(pTHX_ SV *sv)
{
STRLEN len;
- register char *s = SvPV_force(sv, len);
+ register char *s = SvPV(sv, len);
register char * const send = s + len;
register char *base = NULL;
register I32 skipspaces = 0;
my $bas_tests = 20;
# number of tests in section 3
-my $bug_tests = 4 + 3 * 3 * 5 * 2 * 3 + 2 + 2 + 1;
+my $bug_tests = 4 + 3 * 3 * 5 * 2 * 3 + 2 + 2 + 1 + 1;
# number of tests in section 4
my $hmb_tests = 35;
write;
EOP
+fresh_perl_is(<<'EOP', ">ARRAY<\ncrunch_eth\n", {stderr => 1}, '#79532 - formline coerces its arguments');
+use strict;
+use warnings;
+my $zamm = ['crunch_eth'];
+formline $zamm;
+printf ">%s<\n", ref $zamm;
+print "$zamm->[0]\n";
+EOP
+
#############################
## Section 4
## Add new tests *above* here