summaryrefslogtreecommitdiff
path: root/t/op/write.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-02 12:37:30 +0100
committerNicholas Clark <nick@ccl4.org>2011-05-18 19:11:03 +0100
commit37ffbfcca347ea751c9514463873b90f8a496be0 (patch)
treeb5878d733f197a7bcdae2bec4da02ff7b1aa9bdd /t/op/write.t
parent74e0ddf711449aba3fac400d9102bd461ee7265b (diff)
downloadperl-37ffbfcca347ea751c9514463873b90f8a496be0.tar.gz
In S_doparseform(), don't force the pattern to a string. This resolves #79532
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.
Diffstat (limited to 't/op/write.t')
-rw-r--r--t/op/write.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/write.t b/t/op/write.t
index b19db71004..36cb2ad3ac 100644
--- a/t/op/write.t
+++ b/t/op/write.t
@@ -61,7 +61,7 @@ for my $tref ( @NumTests ){
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;
@@ -639,6 +639,15 @@ format =
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