@@ -410,7 +410,9 @@ typedef struct compiler_common {
410410 sljit_s32 match_end_ptr ;
411411 /* Points to the marked string. */
412412 sljit_s32 mark_ptr ;
413- /* Recursive control verb management chain. */
413+ /* Head of the recursive control verb management chain.
414+ Each item must have a previous offset and type
415+ (see control_types) values. See do_search_mark. */
414416 sljit_s32 control_head_ptr ;
415417 /* Points to the last matched capture block index. */
416418 sljit_s32 capture_last_ptr ;
@@ -6650,7 +6652,8 @@ GET_LOCAL_BASE(TMP1, 0, 0);
66506652/* Drop frames until we reach STACK_TOP. */
66516653mainloop = LABEL ();
66526654OP1 (SLJIT_MOV , TMP2 , 0 , SLJIT_MEM1 (STACK_TOP ), - SSIZE_OF (sw ));
6653- jump = CMP (SLJIT_SIG_LESS_EQUAL , TMP2 , 0 , SLJIT_IMM , 0 );
6655+ OP2U (SLJIT_SUB | SLJIT_SET_SIG_LESS_EQUAL | SLJIT_SET_Z , TMP2 , 0 , SLJIT_IMM , 0 );
6656+ jump = JUMP (SLJIT_SIG_LESS_EQUAL );
66546657
66556658OP2 (SLJIT_ADD , TMP2 , 0 , TMP2 , 0 , TMP1 , 0 );
66566659if (HAS_VIRTUAL_REGISTERS )
@@ -6671,7 +6674,8 @@ else
66716674JUMPTO (SLJIT_JUMP , mainloop );
66726675
66736676JUMPHERE (jump );
6674- jump = CMP (SLJIT_NOT_ZERO /* SIG_LESS */ , TMP2 , 0 , SLJIT_IMM , 0 );
6677+ sljit_set_current_flags (compiler , SLJIT_CURRENT_FLAGS_SUB | SLJIT_CURRENT_FLAGS_COMPARE | SLJIT_SET_SIG_LESS_EQUAL | SLJIT_SET_Z );
6678+ jump = JUMP (SLJIT_NOT_ZERO /* SIG_LESS */ );
66756679/* End of reverting values. */
66766680OP_SRC (SLJIT_FAST_RETURN , RETURN_ADDR , 0 );
66776681
@@ -11244,7 +11248,7 @@ switch(opcode)
1124411248 case OP_CBRAPOS :
1124511249 case OP_SCBRAPOS :
1124611250 offset = GET2 (cc , 1 + LINK_SIZE );
11247- /* This case cannot be optimized in the same was as
11251+ /* This case cannot be optimized in the same way as
1124811252 normal capturing brackets. */
1124911253 SLJIT_ASSERT (common -> optimized_cbracket [offset ] == 0 );
1125011254 cbraprivptr = OVECTOR_PRIV (offset );
@@ -13368,12 +13372,19 @@ static SLJIT_INLINE void compile_bracketpos_backtrackingpath(compiler_common *co
1336813372DEFINE_COMPILER ;
1336913373int offset ;
1337013374struct sljit_jump * jump ;
13375+ PCRE2_SPTR cc ;
1337113376
13377+ /* No retry on backtrack, just drop everything. */
1337213378if (CURRENT_AS (bracketpos_backtrack )-> framesize < 0 )
1337313379 {
13374- if (* current -> cc == OP_CBRAPOS || * current -> cc == OP_SCBRAPOS )
13380+ cc = current -> cc ;
13381+
13382+ if (* cc == OP_BRAPOSZERO )
13383+ cc ++ ;
13384+
13385+ if (* cc == OP_CBRAPOS || * cc == OP_SCBRAPOS )
1337513386 {
13376- offset = (GET2 (current -> cc , 1 + LINK_SIZE )) << 1 ;
13387+ offset = (GET2 (cc , 1 + LINK_SIZE )) << 1 ;
1337713388 OP1 (SLJIT_MOV , TMP1 , 0 , SLJIT_MEM1 (STACK_TOP ), STACK (0 ));
1337813389 OP1 (SLJIT_MOV , TMP2 , 0 , SLJIT_MEM1 (STACK_TOP ), STACK (1 ));
1337913390 OP1 (SLJIT_MOV , SLJIT_MEM1 (SLJIT_SP ), OVECTOR (offset ), TMP1 , 0 );
0 commit comments