diff options
author | Tony Cook <tony@develop-help.com> | 2015-08-24 11:46:35 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-08-27 14:00:05 +1000 |
commit | e6b2cf838e87ec34b3a2043c947b4f723d6efcca (patch) | |
tree | 72bbf1f7460d40c7d2a4d39543e646e0e146c7fe /toke.c | |
parent | a9b708ba5552bfe8ce5d5a0291df60aca3b2e883 (diff) | |
download | perl-e6b2cf838e87ec34b3a2043c947b4f723d6efcca.tar.gz |
[perl #125341] check for unexpected trash after any sub start
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -8102,7 +8102,13 @@ Perl_yylex(pTHX) if (*s == ':' && s[1] != ':') PL_expect = attrful; - else if ((*s != '{' && *s != '(') && key == KEY_sub) { + else if ((*s != '{' && *s != '(') && key != KEY_format) { + assert(key == KEY_sub || key == KEY_AUTOLOAD || + key == KEY_DESTROY || key == KEY_BEGIN || + key == KEY_UNITCHECK || key == KEY_CHECK || + key == KEY_INIT || key == KEY_END || + key == KEY_my || key == KEY_state || + key == KEY_our); if (!have_name) Perl_croak(aTHX_ "Illegal declaration of anonymous subroutine"); else if (*s != ';' && *s != '}') |