In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7335cb814c19345052a23bc4462c701ce734e6c5?hp=d07720777420713ab21c454e35fa4c04a729510b>
- Log ----------------------------------------------------------------- commit 7335cb814c19345052a23bc4462c701ce734e6c5 Author: Karl Williamson <[email protected]> Date: Mon Apr 10 10:41:40 2017 -0600 Workaround for GNU Autoconf unescaped left brace See [perl #130497] GNU Autoconf depends on Perl, and will not work on Blead (and the forthcoming Perl 5.26), due to a single unescaped '{', that has previously been deprecated and is now fatal. A patch for it has been in the Autoconf repository since early 2013, but there has not been a release since before then. Because this is depended on by so much code, and because it is simpler than trying to revert to making the fatality merely deprecated, this patch simply changes perl to not die when compiled with the exact pattern that trips up Autoconf. Thus Autoconf can continue to work, but any other patterns that use the now illegal construct will continue to die. If other code uses the exact pattern, they too will not die, but the deprecation message continues to get raised. The use of the left brace in this particular pattern is not one where we envision using the construct to mean something else, so a deprecation is suitable for the foreseeable future. ----------------------------------------------------------------------- Summary of changes: regcomp.c | 24 ++++++++++++++++++++++-- t/re/reg_mesg.t | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/regcomp.c b/regcomp.c index 810c4573d1..54d641d82c 100644 --- a/regcomp.c +++ b/regcomp.c @@ -13387,8 +13387,28 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) * literal string, or when it's the first thing after * something like "\b" */ if (len || (p > RExC_start && isALPHA_A(*(p -1)))) { - RExC_parse = p + 1; - vFAIL("Unescaped left brace in regex is illegal here"); + + /* GNU Autoconf is depended on by a lot of code, and + * can't seem to release a new version that avoids the + * deprecation now made fatal. (A commit to do so has + * been in its repository since early 2013; only one + * pattern is affected.) As a work-around, don't + * fatalize this if the pattern being compiled is the + * precise one that trips up Autoconf. See [perl + * #130497] for more details. */ + if (memNEs(RExC_start, RExC_end - RExC_start, + "\\${[^\\}]*}")) + { + RExC_parse = p + 1; + vFAIL("Unescaped left brace in regex is " + "illegal here"); + } + if (PASS2) { + ckWARNregdep(p + 1, + "Unescaped left brace in regex is " + "deprecated here (and will be fatal " + "in Perl 5.30), passed through"); + } } goto normal_default; case '}': diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t index 597df92d5b..b80b692e62 100644 --- a/t/re/reg_mesg.t +++ b/t/re/reg_mesg.t @@ -652,6 +652,7 @@ my @deprecated = ( '/.{/' => 'Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through {#} m/.{{#}/', '/[x]{/' => 'Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through {#} m/[x]{{#}/', '/\p{Latin}{/' => 'Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through {#} m/\p{Latin}{{#}/', + '/\\${[^\\}]*}/' => 'Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through {#} m/\\${{#}[^\\}]*}/', ); for my $strict ("", "use re 'strict';") { -- Perl5 Master Repository
