diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-11-22 17:41:23 -0700 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2010-11-22 20:19:08 -0500 |
commit | 1eb41b0abe1a265118fa38f67089e4aef313f69b (patch) | |
tree | 024988b90f29905323fd9c6609fbeadc5e5896de /regcomp.h | |
parent | 99ee976292c47b41b12e66dc2a0fea4a98c9ab9f (diff) | |
download | perl-1eb41b0abe1a265118fa38f67089e4aef313f69b.tar.gz |
regcomp.h: Restore separate bit for LOC class
This commit partially reverts cefafd73018b048fa66d2b22250431112141955a
which unconditionally used a bitmap for classes like \w in ANYOF nodes
used in locales. Unfortunately, I forgot to unconditionally allocate
that space, so things were getting corrupted. It is scary that that did
not show up in my testing, but locales are hard to test. It showed up
in a workspace without DEBUGGING.
This commit now causes the bitmap to be used only when necessary, at the
expense of using a precious bit in the flags field to indicate that it
is being used. However, as events have turned out since that commit,
that flags bit isn't as precious as I thought. It looks like we will
have to split the ANYOF node into two similar nodes, one of which is
variable length, as there are bugs due to the optimizer thinking it is
of length 1, when in fact it doesn't currently have to be. That split
should allow more bits to be freed.
I'm retaining for now some ancillary code that was to help improve the
efficiency when that bit was removed; just in case we have to redo this.
But if we do, we have to unconditionally allocate the space we think we
are using.
Signed-off-by: David Golden <dagolden@cpan.org>
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -319,8 +319,7 @@ struct regnode_charclass_class { #define ANYOF_INVERT 0x04 /* CLASS is never set unless LOCALE is too: has runtime \d, \w, [:posix:], ... */ -/* For now, set it always when LOCALE is set, to save a bit for other uses. */ -#define ANYOF_CLASS ANYOF_LOCALE +#define ANYOF_CLASS 0x08 #define ANYOF_LARGE ANYOF_CLASS /* Same; name retained for back compat */ /* Can match something outside the bitmap that is expressible only in utf8 */ |