summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-08-15 10:59:01 -0600
committerKarl Williamson <public@khwilliamson.com>2013-09-24 11:36:16 -0600
commit01822b745cf22c5f129312061022b109fc43bf61 (patch)
treedb411a54c7ad632570e9a8c635608b3d0b1181c1 /regcomp.c
parent81c80d3d62803334acb37662199774c9bd6ccf5c (diff)
downloadperl-01822b745cf22c5f129312061022b109fc43bf61.tar.gz
Remove PL_ASCII; use existing array slots for it
PL_ASCII contains an inversion list to match the ASCII-range code points. It is unusable outside the core regular expression code because all the functions that manipulate inversion lists are defined only within a few core files. Therefore no outside code should be depending on it. It turns out that there are arrays of similar inversion lists, and these all have slots which should have this inversion list in them. This commit fills them, instead of using PL_ASCII.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 61f61eece4..7d863beec2 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5545,10 +5545,13 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
* having to test them each time otherwise */
if (! PL_AboveLatin1) {
PL_AboveLatin1 = _new_invlist_C_array(AboveLatin1_invlist);
- PL_ASCII = _new_invlist_C_array(ASCII_invlist);
PL_Latin1 = _new_invlist_C_array(Latin1_invlist);
PL_UpperLatin1 = _new_invlist_C_array(UpperLatin1_invlist);
+ PL_Posix_ptrs[_CC_ASCII] = _new_invlist_C_array(ASCII_invlist);
+ PL_L1Posix_ptrs[_CC_ASCII] = _new_invlist_C_array(ASCII_invlist);
+ PL_XPosix_ptrs[_CC_ASCII] = _new_invlist_C_array(ASCII_invlist);
+
PL_L1Posix_ptrs[_CC_ALPHANUMERIC]
= _new_invlist_C_array(L1PosixAlnum_invlist);
PL_Posix_ptrs[_CC_ALPHANUMERIC]
@@ -12840,7 +12843,7 @@ parseit:
#endif /* Not isascii(); just use the hard-coded definition for it */
_invlist_union_maybe_complement_2nd(
posixes,
- PL_ASCII,
+ PL_Posix_ptrs[_CC_ASCII],
cBOOL(namedclass % 2), /* Complement if odd
(NASCII) */
&posixes);