File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,8 @@ matches to an empty string (also represented by a non-zero value). */
560
560
561
561
for (;;)
562
562
{
563
+ PCRE2_SPTR bracode ;
564
+
563
565
/* All operations move the code pointer forward.
564
566
Therefore infinite recursions are not possible. */
565
567
@@ -616,8 +618,9 @@ for(;;)
616
618
so its last iterator can never be possessified if the pattern contains
617
619
recursions. (This could be improved by keeping a list of group numbers that
618
620
are called by recursion.) */
619
-
620
- switch (* (code - GET (code , 1 )))
621
+
622
+ bracode = code - GET (code , 1 );
623
+ switch (* bracode )
621
624
{
622
625
case OP_CBRA :
623
626
case OP_SCBRA :
@@ -636,16 +639,19 @@ for(;;)
636
639
break ;
637
640
638
641
/* Atomic sub-patterns and assertions can always auto-possessify their
639
- last iterator. However, if the group was entered as a result of checking
640
- a previous iterator, this is not possible. */
642
+ last iterator except for variable length lookbehinds. However, if the
643
+ group was entered as a result of checking a previous iterator, this is
644
+ not possible. */
641
645
642
646
case OP_ASSERT :
643
647
case OP_ASSERT_NOT :
644
- case OP_ASSERTBACK :
645
- case OP_ASSERTBACK_NOT :
646
648
case OP_ONCE :
647
649
return !entered_a_group ;
648
650
651
+ case OP_ASSERTBACK :
652
+ case OP_ASSERTBACK_NOT :
653
+ return (bracode [1 + LINK_SIZE ] == OP_VREVERSE )? FALSE : !entered_a_group ;
654
+
649
655
/* Non-atomic assertions - don't possessify last iterator. This needs
650
656
more thought. */
651
657
Original file line number Diff line number Diff line change @@ -6651,4 +6651,7 @@ $/x
6651
6651
/^..A(*SKIP)B|C/
6652
6652
12ADC
6653
6653
6654
+ /(?<!a?)/
6655
+ a
6656
+
6654
6657
# End of testinput1
Original file line number Diff line number Diff line change @@ -10499,4 +10499,8 @@ No match
10499
10499
12ADC
10500
10500
0: C
10501
10501
10502
+ /(?<!a?)/
10503
+ a
10504
+ No match
10505
+
10502
10506
# End of testinput1
You can’t perform that action at this time.
0 commit comments