Skip to content

Commit ee12ec5

Browse files
authored
Remove one of the jumps
1 parent 11afce6 commit ee12ec5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/pcre2_jit_compile.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13779,8 +13779,7 @@ lookbehind). */
1377913779
if (common->has_set_som &&
1378013780
(common->re->extra_options & PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) == 0)
1378113781
{
13782-
struct sljit_jump *bad_som_behind;
13783-
struct sljit_jump *bad_som_ahead;
13782+
struct sljit_jump *do_return;
1378413783
struct sljit_jump *fallthrough;
1378513784

1378613785
if (HAS_VIRTUAL_REGISTERS)
@@ -13794,13 +13793,11 @@ if (common->has_set_som &&
1379413793
}
1379513794

1379613795
/* (ovector[0] < jit_arguments->str)? */
13797-
bad_som_behind = CMP(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), TMP1, 0);
13798-
/* (ovector[0] > STR_PTR)? NB. ovector[1] hasn't yet been set to STR_PTR. */
13799-
bad_som_ahead = CMP(SLJIT_GREATER, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), STR_PTR, 0);
13800-
fallthrough = JUMP(SLJIT_JUMP);
13796+
do_return = CMP(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), TMP1, 0);
13797+
/* (ovector[0] <= STR_PTR)? NB. ovector[1] hasn't yet been set to STR_PTR. */
13798+
fallthrough = CMP(SLJIT_LESS_EQUAL, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), STR_PTR, 0);
1380113799

13802-
JUMPHERE(bad_som_behind);
13803-
JUMPHERE(bad_som_ahead);
13800+
JUMPHERE(do_return);
1380413801
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_BAD_BACKSLASH_K);
1380513802
add_jump(compiler, &common->abort, JUMP(SLJIT_JUMP));
1380613803

0 commit comments

Comments
 (0)