diff options
author | Sam Tregar <sam@tregar.com> | 2001-12-30 14:57:55 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-31 04:05:46 +0000 |
commit | 2f758a169336880aced9e22abce6d9196c383e06 (patch) | |
tree | 7a2489ca4726146a64445ca6f5b359f65ee0f535 /toke.c | |
parent | 443a5b981950c0a4ba09217be56a57cb04e64247 (diff) | |
download | perl-2f758a169336880aced9e22abce6d9196c383e06.tar.gz |
Basic bad prototype detection
Message-ID: <Pine.LNX.4.33.0112301948270.9102-200000@localhost.localdomain>
p4raw-id: //depot/perl@13971
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4952,10 +4952,13 @@ Perl_yylex(pTHX) s = scan_str(s,FALSE,FALSE); if (!s) Perl_croak(aTHX_ "Prototype not terminated"); - /* strip spaces */ + /* strip spaces and check for bad characters */ d = SvPVX(PL_lex_stuff); tmp = 0; for (p = d; *p; ++p) { + if (!strchr("$@%*;[]&\\ ", *p)) + Perl_croak(aTHX_ "Malformed prototype for %s : %s", + SvPVX(PL_subname), d); if (!isSPACE(*p)) d[tmp++] = *p; } |