This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #125540] handle already being at EOF while not finding a heredoc terminator
authorTony Cook <tony@develop-help.com>
Wed, 20 Jan 2016 04:35:13 +0000 (15:35 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 3 Feb 2016 03:41:46 +0000 (14:41 +1100)
commit23c4e91245a43fb7bbe5215e27ca989e3b410552
tree8c71325a2b7be23875d4dec17398c0bf0ef2b05e
parentc95ea6823bf0611c3ce863cdc508a66b52523d34
[perl #125540] handle already being at EOF while not finding a heredoc terminator

In some cases, S_scan_heredoc() can already be at end of file and
PL_rsfp is NULL.  If we're on the final line and that line has no
newline we'd assert or crash.

Now, if we don't find that newline, we obviously can't find the
terminator, so go straight to reporting the missing terminator.

I considered setting s to PL_bufend, but that would just be more
work to print the same message.
t/op/heredoc.t
toke.c