diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-02 12:37:30 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-05-18 19:11:03 +0100 |
commit | 37ffbfcca347ea751c9514463873b90f8a496be0 (patch) | |
tree | b5878d733f197a7bcdae2bec4da02ff7b1aa9bdd /t | |
parent | 74e0ddf711449aba3fac400d9102bd461ee7265b (diff) | |
download | perl-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')
-rw-r--r-- | t/op/write.t | 11 |
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 |