This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Avoid locale in optimizer unless necessary
authorKarl Williamson <public@khwilliamson.com>
Thu, 17 Mar 2011 16:24:28 +0000 (10:24 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 17 Mar 2011 17:00:50 +0000 (11:00 -0600)
commit3fffb88a6cabe9bc42e2a62f0ab7442ba6850dd0
tree66e6ac2fdec3b07d7e52cbe5df8c8f9c3574ff35
parent77dc54c8ed3f77947d97b9085c718de3fc7fb81f
regcomp.c: Avoid locale in optimizer unless necessary

This is further work along the lines in RT #85964 and commit
af302e7fa58415c2d8454c8cbef7bccd8b504257.  It reverts, for the the most
part, commits aa19b56b2f07e9eabf57540f00d312d8093e9d28 (Remove unused
parameter) and c613755a4b4fc8e64a77639d47d7e208fee68edc (/l in synthetic
start class).

Those commits caused the synthetic start class to often be marked as
matching under locale rules, even if there was no part of the regular
expression that used locale.  This led to RT #85964, which made apparent
that there were a number of assumptions in the optimizer about locale
that were no longer necessarily true.  This new commit changes things so
that locale has to be somewhere in the regex in order to get the
synthetic start class to include /l.  In other words, this reverts the
effect of those commits to regular expression which have /l -- we go
back to the old way of doing things for non-locale regexes.  This limits
any bugs that may have been introduced by the addition of /l (and being
able to match only sub-parts of a regex under locale) to the relatively
uncommon regexes which actually use it.  There are a number of bugs
that have surfaced for the locale rules regexes that have gone
unreported; and some say locale rules regexes should be deprecated.
embed.fnc
proto.h
regcomp.c