@@ -2505,8 +2505,8 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch,
2505
2505
2506
2506
for ( cur = first ; cur < last ; cur = regnext( cur ) ) {
2507
2507
regnode *noper = NEXTOPER( cur );
2508
- const U8 *uc = (U8*)STRING( noper ) ;
2509
- const U8 *e = uc + STR_LEN( noper ) ;
2508
+ const U8 *uc;
2509
+ const U8 *e;
2510
2510
int foldlen = 0;
2511
2511
U32 wordlen = 0; /* required init */
2512
2512
STRLEN minchars = 0;
@@ -2516,17 +2516,19 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch,
2516
2516
2517
2517
if (OP(noper) == NOTHING) {
2518
2518
regnode *noper_next= regnext(noper);
2519
- if (noper_next != tail && OP(noper_next) == flags) {
2520
- noper = noper_next;
2521
- uc= (U8*)STRING(noper);
2522
- e= uc + STR_LEN(noper);
2523
- trie->minlen= STR_LEN(noper);
2524
- } else {
2525
- trie->minlen= 0;
2526
- continue;
2527
- }
2519
+ if (noper_next < tail)
2520
+ noper= noper_next;
2521
+ }
2522
+
2523
+ if ( noper < tail && ( OP(noper) == flags || ( flags == EXACTFU && OP(noper) == EXACTFU_SS ) ) ) {
2524
+ uc= (U8*)STRING(noper);
2525
+ e= uc + STR_LEN(noper);
2526
+ } else {
2527
+ trie->minlen= 0;
2528
+ continue;
2528
2529
}
2529
2530
2531
+
2530
2532
if ( set_bit ) { /* bitmap only alloced when !(UTF&&Folding) */
2531
2533
TRIE_BITMAP_SET(trie,*uc); /* store the raw first byte
2532
2534
regardless of encoding */
@@ -2732,22 +2734,20 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch,
2732
2734
for ( cur = first ; cur < last ; cur = regnext( cur ) ) {
2733
2735
2734
2736
regnode *noper = NEXTOPER( cur );
2735
- U8 *uc = (U8*)STRING( noper );
2736
- const U8 *e = uc + STR_LEN( noper );
2737
2737
U32 state = 1; /* required init */
2738
2738
U16 charid = 0; /* sanity init */
2739
2739
U32 wordlen = 0; /* required init */
2740
2740
2741
2741
if (OP(noper) == NOTHING) {
2742
2742
regnode *noper_next= regnext(noper);
2743
- if (noper_next != tail && OP(noper_next) == flags) {
2744
- noper = noper_next;
2745
- uc= (U8*)STRING(noper);
2746
- e= uc + STR_LEN(noper);
2747
- }
2743
+ if (noper_next < tail)
2744
+ noper= noper_next;
2748
2745
}
2749
2746
2750
- if (OP(noper) != NOTHING) {
2747
+ if ( noper < tail && ( OP(noper) == flags || ( flags == EXACTFU && OP(noper) == EXACTFU_SS ) ) ) {
2748
+ const U8 *uc= (U8*)STRING(noper);
2749
+ const U8 *e= uc + STR_LEN(noper);
2750
+
2751
2751
for ( ; uc < e ; uc += len ) {
2752
2752
2753
2753
TRIE_READ_CHAR;
@@ -2951,8 +2951,6 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch,
2951
2951
for ( cur = first ; cur < last ; cur = regnext( cur ) ) {
2952
2952
2953
2953
regnode *noper = NEXTOPER( cur );
2954
- const U8 *uc = (U8*)STRING( noper );
2955
- const U8 *e = uc + STR_LEN( noper );
2956
2954
2957
2955
U32 state = 1; /* required init */
2958
2956
@@ -2963,14 +2961,14 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch,
2963
2961
2964
2962
if (OP(noper) == NOTHING) {
2965
2963
regnode *noper_next= regnext(noper);
2966
- if (noper_next != tail && OP(noper_next) == flags) {
2967
- noper = noper_next;
2968
- uc= (U8*)STRING(noper);
2969
- e= uc + STR_LEN(noper);
2970
- }
2964
+ if (noper_next < tail)
2965
+ noper= noper_next;
2971
2966
}
2972
2967
2973
- if ( OP(noper) != NOTHING ) {
2968
+ if ( noper < tail && ( OP(noper) == flags || ( flags == EXACTFU && OP(noper) == EXACTFU_SS ) ) ) {
2969
+ const U8 *uc= (U8*)STRING(noper);
2970
+ const U8 *e= uc + STR_LEN(noper);
2971
+
2974
2972
for ( ; uc < e ; uc += len ) {
2975
2973
2976
2974
TRIE_READ_CHAR;
0 commit comments