From 62db6ea5fed19611596cbc5fc0b8a4df2c604e58 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 19 Jan 2015 16:03:18 +1100 Subject: [PATCH] [perl #123538] always set chophere and itembytes at the same time Previously this would crash in FF_MORE because chophere was still NULL. --- pp_ctl.c | 1 + t/op/write.t | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pp_ctl.c b/pp_ctl.c index 37b822cf575c..c76347b7b916 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -586,6 +586,7 @@ PP(pp_formline) break; } itembytes = s - item; + chophere = s; break; } diff --git a/t/op/write.t b/t/op/write.t index 4b130575b59d..590d6581ebc0 100644 --- a/t/op/write.t +++ b/t/op/write.t @@ -98,7 +98,7 @@ for my $tref ( @NumTests ){ my $bas_tests = 21; # number of tests in section 3 -my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 11 + 2; +my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 11 + 3; # number of tests in section 4 my $hmb_tests = 37; @@ -1960,6 +1960,18 @@ dd| EXPECT { stderr => 1 }, '#123245 different panic in sv_chop'); +fresh_perl_is(<<'EOP', <<'EXPECT', +format STDOUT = +# x at the end to make the spaces visible +@... x +q/a/ +. +write; +EOP +a x +EXPECT + { stderr => 1 }, '#123538 crash in FF_MORE'); + ############################# ## Section 4 ## Add new tests *above* here