summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-01-15 09:45:24 -0700
committerKarl Williamson <public@khwilliamson.com>2011-01-16 08:18:54 -0700
commitf424400810b6af341e96230836690da51c37b812 (patch)
tree28d71e6f599eaa41330f7919e90ffd6b6367a5f2 /regcomp.c
parentd658a8a81c4f311bef688fd51df924a424429f14 (diff)
downloadperl-f424400810b6af341e96230836690da51c37b812.tar.gz
regcomp: Share two bits in ANYOF flags
It turns out that the INVERT and EOS flags can actually share the same bit, as explained in the comments, freeing up a bit for other uses. No code changes need be made.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index b39cf5cc0c..fa8f44ba98 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4985,6 +4985,9 @@ reStudy:
if (ri->regstclass
&& (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)
@@ -5057,6 +5060,9 @@ 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))
{