@@ -1236,15 +1236,16 @@ return TRUE;
1236
1236
1237
1237
return: current number of iterators enhanced with fast fail
1238
1238
*/
1239
- static int detect_early_fail (compiler_common * common , PCRE2_SPTR cc , int * private_data_start , sljit_s32 depth , int start )
1239
+ static int detect_early_fail (compiler_common * common , PCRE2_SPTR cc , int * private_data_start ,
1240
+ sljit_s32 depth , int start , BOOL fast_forward_allowed )
1240
1241
{
1241
1242
PCRE2_SPTR begin = cc ;
1242
1243
PCRE2_SPTR next_alt ;
1243
1244
PCRE2_SPTR end ;
1244
1245
PCRE2_SPTR accelerated_start ;
1246
+ BOOL prev_fast_forward_allowed ;
1245
1247
int result = 0 ;
1246
1248
int count ;
1247
- BOOL fast_forward_allowed = TRUE;
1248
1249
1249
1250
SLJIT_ASSERT (* cc == OP_ONCE || * cc == OP_BRA || * cc == OP_CBRA );
1250
1251
SLJIT_ASSERT (* cc != OP_CBRA || common -> optimized_cbracket [GET2 (cc , 1 + LINK_SIZE )] != 0 );
1476
1477
case OP_CBRA :
1477
1478
end = cc + GET (cc , 1 );
1478
1479
1480
+ prev_fast_forward_allowed = fast_forward_allowed ;
1479
1481
fast_forward_allowed = FALSE;
1480
1482
if (depth >= 4 )
1481
1483
break ;
1484
1486
if (* end != OP_KET || (* cc == OP_CBRA && common -> optimized_cbracket [GET2 (cc , 1 + LINK_SIZE )] == 0 ))
1485
1487
break ;
1486
1488
1487
- count = detect_early_fail (common , cc , private_data_start , depth + 1 , count );
1489
+ count = detect_early_fail (common , cc , private_data_start , depth + 1 , count , prev_fast_forward_allowed );
1488
1490
1489
1491
if (PRIVATE_DATA (cc ) != 0 )
1490
1492
common -> private_data_ptrs [begin - common -> start ] = 1 ;
@@ -13657,7 +13659,7 @@ memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32));
13657
13659
private_data_size = common -> cbra_ptr + (re -> top_bracket + 1 ) * sizeof (sljit_sw );
13658
13660
13659
13661
if ((re -> overall_options & PCRE2_ANCHORED ) == 0 && (re -> overall_options & PCRE2_NO_START_OPTIMIZE ) == 0 && !common -> has_skip_in_assert_back )
13660
- detect_early_fail (common , common -> start , & private_data_size , 0 , 0 );
13662
+ detect_early_fail (common , common -> start , & private_data_size , 0 , 0 , TRUE );
13661
13663
13662
13664
set_private_data_ptrs (common , & private_data_size , ccend );
13663
13665
0 commit comments