diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-03-17 10:24:28 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-03-17 11:00:50 -0600 |
commit | 3fffb88a6cabe9bc42e2a62f0ab7442ba6850dd0 (patch) | |
tree | 66e6ac2fdec3b07d7e52cbe5df8c8f9c3574ff35 /proto.h | |
parent | 77dc54c8ed3f77947d97b9085c718de3fc7fb81f (diff) | |
download | perl-3fffb88a6cabe9bc42e2a62f0ab7442ba6850dd0.tar.gz |
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.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -5988,10 +5988,11 @@ STATIC void S_cl_and(struct regnode_charclass_class *cl, const struct regnode_ch #define PERL_ARGS_ASSERT_CL_AND \ assert(cl); assert(and_with) -STATIC void S_cl_anything(struct regnode_charclass_class *cl) - __attribute__nonnull__(1); +STATIC void S_cl_anything(const struct RExC_state_t *pRExC_state, struct regnode_charclass_class *cl) + __attribute__nonnull__(1) + __attribute__nonnull__(2); #define PERL_ARGS_ASSERT_CL_ANYTHING \ - assert(cl) + assert(pRExC_state); assert(cl) STATIC void S_cl_init(const struct RExC_state_t *pRExC_state, struct regnode_charclass_class *cl) __attribute__nonnull__(1) @@ -6005,11 +6006,12 @@ STATIC int S_cl_is_anything(const struct regnode_charclass_class *cl) #define PERL_ARGS_ASSERT_CL_IS_ANYTHING \ assert(cl) -STATIC void S_cl_or(struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with) +STATIC void S_cl_or(const struct RExC_state_t *pRExC_state, struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with) __attribute__nonnull__(1) - __attribute__nonnull__(2); + __attribute__nonnull__(2) + __attribute__nonnull__(3); #define PERL_ARGS_ASSERT_CL_OR \ - assert(cl); assert(or_with) + assert(pRExC_state); assert(cl); assert(or_with) PERL_STATIC_INLINE UV* S_invlist_array(pTHX_ HV* const invlist) __attribute__warn_unused_result__ |