From 37ffbfcca347ea751c9514463873b90f8a496be0 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 2 May 2011 12:37:30 +0100 Subject: 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. --- t/op/write.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 't') 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 -- cgit v1.2.1