diff options
-rw-r--r-- | pp_ctl.c | 10 | ||||
-rw-r--r-- | t/op/write.t | 11 |
2 files changed, 12 insertions, 9 deletions
@@ -554,13 +554,7 @@ PP(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; @@ -4923,7 +4917,7 @@ static MAGIC * 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; 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 |