Skip to content

Commit

Permalink
[perl #123538] always set chophere and itembytes at the same time
Browse files Browse the repository at this point in the history
Previously this would crash in FF_MORE because chophere was still
NULL.
  • Loading branch information
tonycoz committed Jan 19, 2015
1 parent e3e8f26 commit 62db6ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions pp_ctl.c
Expand Up @@ -586,6 +586,7 @@ PP(pp_formline)
break;
}
itembytes = s - item;
chophere = s;
break;
}

Expand Down
14 changes: 13 additions & 1 deletion t/op/write.t
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62db6ea

Please sign in to comment.