From: Rafael Garcia-Suarez Date: Thu, 11 Feb 2010 09:32:01 +0000 (+0100) Subject: [perl #72590] Panic if 'use strict' and forget 'my' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78c4a74a09b8f7ed410a879bd78dfb83cbf7861c;p=p5sagit%2Fp5-mst-13.2.git [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. --- diff --git a/regcomp.c b/regcomp.c index ecea32d..0b27364 100644 --- a/regcomp.c +++ b/regcomp.c @@ -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 ;