This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: UTF /l should not use tries
authorKarl Williamson <public@khwilliamson.com>
Tue, 8 Mar 2011 23:30:00 +0000 (16:30 -0700)
committerKarl Williamson <public@khwilliamson.com>
Wed, 9 Mar 2011 06:22:17 +0000 (23:22 -0700)
It's unclear if tries will work under /l.  I haven't seen any failures,
but there have been under /d.  As a precaution, until more testing is
done, disable tries under anything but /u and UTF.

regcomp.c

index 620b026..be90fca 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -2939,10 +2939,13 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
     If/when this is fixed the following define can be swapped
     in below to fully enable trie logic.
 
+    XXX It may work if not UTF and/or /a (AT_LEAST_UNI_SEMANTICS) but perhaps
+    not /aa
+
 #define TRIE_TYPE_IS_SAFE 1
 
 */
-#define TRIE_TYPE_IS_SAFE (UTF || optype==EXACT)
+#define TRIE_TYPE_IS_SAFE ((UTF && UNI_SEMANTICS) || optype==EXACT)
 
                                 if ( last && TRIE_TYPE_IS_SAFE ) {
                                     make_trie( pRExC_state,