diff options
author | Lukas Mai <l.mai@web.de> | 2015-08-17 21:59:41 +0200 |
---|---|---|
committer | Lukas Mai <l.mai@web.de> | 2015-08-18 22:34:22 +0200 |
commit | f3106bc89eb4bbffee5ca7cb67bd63d2f3ce87bf (patch) | |
tree | e76f7aee1fd75771d5e78d487e7131761c494f4d /toke.c | |
parent | 9cd8e8a586b62830fc3c73f9acb7411a1639c3ce (diff) | |
download | perl-f3106bc89eb4bbffee5ca7cb67bd63d2f3ce87bf.tar.gz |
disallow nested declarations [perl #125587] [perl #121058]
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -7605,6 +7605,14 @@ Perl_yylex(pTHX) case KEY_our: case KEY_my: case KEY_state: + if (PL_in_my) { + yyerror(Perl_form(aTHX_ + "Can't redeclare \"%s\" in \"%s\"", + tmp == KEY_my ? "my" : + tmp == KEY_state ? "state" : "our", + PL_in_my == KEY_my ? "my" : + PL_in_my == KEY_state ? "state" : "our")); + } PL_in_my = (U16)tmp; s = skipspace(s); if (isIDFIRST_lazy_if(s,UTF)) { |