diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-02-11 10:32:01 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-02-11 10:32:01 +0100 |
commit | 78c4a74a09b8f7ed410a879bd78dfb83cbf7861c (patch) | |
tree | f1b63a13b16d29b619a6a867ebcbaa211ead8892 /regcomp.c | |
parent | 482d21b3db741a7f6b59279ab7ad289307e2186b (diff) | |
download | perl-78c4a74a09b8f7ed410a879bd78dfb83cbf7861c.tar.gz |
[perl #72590] Panic if 'use strict' and forget 'my'
That bug happens when we detect a compilation error in the statement
being parsed, and when the continuation of the parsing of that same
statement needs to load the file unicore/Name.pl via charnames.pm.
In that case perl gets confused, fails to parse Name.pl because
the parser is already in error, and also fails to properly rewind
to a normal error-reporting state.
This patch does not attempt to fix the whole error-reporting process;
instead, it simply prevents perl from trying to load charnames if it has
already recorded a parse error. So, in a way, it hides the bug under
the carpet. However, this is a safe fix, suitable for a code-freeze
stage.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -6722,6 +6722,9 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep, I32 *flagp) if ( he_str ) { sv_str = HeVAL(he_str); cached = 1; + } else if (PL_parser && PL_parser->error_count > 0) { + /* Don't attempt to load charnames if we're already in error */ + vFAIL("Too many errors, cannot continue parsing"); } else { dSP ; |