summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-03-08 17:06:47 -0700
committerKarl Williamson <public@khwilliamson.com>2011-03-08 23:22:17 -0700
commitc613755a4b4fc8e64a77639d47d7e208fee68edc (patch)
tree79d619f3808d2f33e5d8613e59e16ebf74c3fc03 /regcomp.c
parentf0c16e54b3b5efbb4380952c7ba5e8d7626d7cae (diff)
downloadperl-c613755a4b4fc8e64a77639d47d7e208fee68edc.tar.gz
regex: /l in combo with others in syn start class
Now that regexes can be combinations of different charset modifiers, a synthetic start class can match locale and non-locale both. locale should generally match only things in the bitmap for code points < 256. But a synthetic start class with a non-locale component can match such code points. This patch makes an exception for synthetic nodes that will be resolved if it passes and is matched again for real.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/regcomp.c b/regcomp.c
index be90fca0ff..15dcf3a15e 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5014,14 +5014,13 @@ reStudy:
&& (OP(ri->regstclass) == REG_ANY || OP(ri->regstclass) == SANY))
ri->regstclass = NULL;
- /* If the synthetic start class were to ever be used when EOS is set,
- * that bit would have to be cleared, as it is shared with another */
if ((!(r->anchored_substr || r->anchored_utf8) || r->anchored_offset)
&& stclass_flag
&& !(data.start_class->flags & ANYOF_EOS)
&& !cl_is_anything(data.start_class))
{
const U32 n = add_data(pRExC_state, 1, "f");
+ data.start_class->flags |= ANYOF_IS_SYNTHETIC;
Newx(RExC_rxi->data->data[n], 1,
struct regnode_charclass_class);
@@ -5089,12 +5088,11 @@ reStudy:
r->check_substr = r->check_utf8 = r->anchored_substr = r->anchored_utf8
= r->float_substr = r->float_utf8 = NULL;
- /* If the synthetic start class were to ever be used when EOS is set,
- * that bit would have to be cleared, as it is shared with another */
if (!(data.start_class->flags & ANYOF_EOS)
&& !cl_is_anything(data.start_class))
{
const U32 n = add_data(pRExC_state, 1, "f");
+ data.start_class->flags |= ANYOF_IS_SYNTHETIC;
Newx(RExC_rxi->data->data[n], 1,
struct regnode_charclass_class);