summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-10-16 12:00:13 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-17 21:52:16 -0600
commitb36527fc35dbde0cdd3f0d1808de479b5b70ee85 (patch)
treea0dc71445d744af25360d2a8706275ef49ac86a0
parente067297c376fbbb5a0dc8428c65d922f11e1f4c6 (diff)
downloadperl-b36527fc35dbde0cdd3f0d1808de479b5b70ee85.tar.gz
regcomp.c: generate folded for EXACTF and EXACTFU
regcomp.c folds the string in these two nodes except in one case. Change that case to correspond with the predominant behavior. This enables future optimizations
-rw-r--r--globvar.sym1
-rw-r--r--regcomp.c11
-rw-r--r--t/porting/globvar.t2
3 files changed, 11 insertions, 3 deletions
diff --git a/globvar.sym b/globvar.sym
index a8067e5a69..93eca43ea1 100644
--- a/globvar.sym
+++ b/globvar.sym
@@ -18,6 +18,7 @@ hexdigit
interp_size
interp_size_5_16_0
keyword_plugin
+latin1_lc
magic_data
magic_vtable_names
magic_vtables
diff --git a/regcomp.c b/regcomp.c
index 579dabec5a..40d08e9f4f 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -10702,8 +10702,14 @@ parseit:
else {
op = EXACT;
}
- } /* else 2 chars in the bit map: the folds of each other */
- else if (AT_LEAST_UNI_SEMANTICS || !isASCII(value)) {
+ }
+ else { /* else 2 chars in the bit map: the folds of each other */
+
+ /* Use the folded value, which for the cases where we get here,
+ * is just the lower case of the current one (which may resolve to
+ * itself, or to the other one */
+ value = toLOWER_LATIN1(value);
+ if (AT_LEAST_UNI_SEMANTICS || !isASCII(value)) {
/* To join adjacent nodes, they must be the exact EXACTish type.
* Try to use the most likely type, by using EXACTFU if the regex
@@ -10714,6 +10720,7 @@ parseit:
else { /* Otherwise, more likely to be EXACTF type */
op = EXACTF;
}
+ }
ret = reg_node(pRExC_state, op);
RExC_parse = (char *)cur_parse;
diff --git a/t/porting/globvar.t b/t/porting/globvar.t
index aa266959c2..795673b49a 100644
--- a/t/porting/globvar.t
+++ b/t/porting/globvar.t
@@ -14,7 +14,7 @@ skip_all("Code to read symbols not ported to $^O")
my %skip = map { ("PL_$_", 1) }
qw(
DBcv bitcount cshname force_link_funcs generation lastgotoprobe
- latin1_lc mod_latin1_uc modcount no_symref_sv timesbuf uudmap
+ mod_latin1_uc modcount no_symref_sv timesbuf uudmap
watchaddr watchok warn_uninit_sv
);