diff options
author | Jakub Marcowski <chubercikbattle@gmail.com> | 2024-03-11 03:15:07 +0100 |
---|---|---|
committer | Jakub Marcowski <chubercikbattle@gmail.com> | 2024-03-11 11:42:02 +0100 |
commit | dab95993c6c8ebd4fb439385a892dabda22698a2 (patch) | |
tree | 98084c35eb94c5ab63c7be5d564251b3d18dc70d /thirdparty/pcre2/src/pcre2_auto_possess.c | |
parent | 810f127022ec2cbfb288e436151d1a777c7b5da7 (diff) | |
download | redot-engine-dab95993c6c8ebd4fb439385a892dabda22698a2.tar.gz |
pcre2: Update to 10.43
Diffstat (limited to 'thirdparty/pcre2/src/pcre2_auto_possess.c')
-rw-r--r-- | thirdparty/pcre2/src/pcre2_auto_possess.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/thirdparty/pcre2/src/pcre2_auto_possess.c b/thirdparty/pcre2/src/pcre2_auto_possess.c index 419fd49001..210d13d37a 100644 --- a/thirdparty/pcre2/src/pcre2_auto_possess.c +++ b/thirdparty/pcre2/src/pcre2_auto_possess.c @@ -560,6 +560,8 @@ matches to an empty string (also represented by a non-zero value). */ for(;;) { + PCRE2_SPTR bracode; + /* All operations move the code pointer forward. Therefore infinite recursions are not possible. */ @@ -617,7 +619,8 @@ for(;;) recursions. (This could be improved by keeping a list of group numbers that are called by recursion.) */ - switch(*(code - GET(code, 1))) + bracode = code - GET(code, 1); + switch(*bracode) { case OP_CBRA: case OP_SCBRA: @@ -636,16 +639,19 @@ for(;;) break; /* Atomic sub-patterns and assertions can always auto-possessify their - last iterator. However, if the group was entered as a result of checking - a previous iterator, this is not possible. */ + last iterator except for variable length lookbehinds. However, if the + group was entered as a result of checking a previous iterator, this is + not possible. */ case OP_ASSERT: case OP_ASSERT_NOT: - case OP_ASSERTBACK: - case OP_ASSERTBACK_NOT: case OP_ONCE: return !entered_a_group; + case OP_ASSERTBACK: + case OP_ASSERTBACK_NOT: + return (bracode[1+LINK_SIZE] == OP_VREVERSE)? FALSE : !entered_a_group; + /* Non-atomic assertions - don't possessify last iterator. This needs more thought. */ |