diff options
Diffstat (limited to 'thirdparty/pcre2/src/pcre2_auto_possess.c')
-rw-r--r-- | thirdparty/pcre2/src/pcre2_auto_possess.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/thirdparty/pcre2/src/pcre2_auto_possess.c b/thirdparty/pcre2/src/pcre2_auto_possess.c index 2ce152e952..6d7b7c4a4d 100644 --- a/thirdparty/pcre2/src/pcre2_auto_possess.c +++ b/thirdparty/pcre2/src/pcre2_auto_possess.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -605,6 +605,15 @@ for(;;) if (cb->had_recurse) return FALSE; break; + /* A script run might have to backtrack if the iterated item can match + characters from more than one script. So give up unless repeating an + explicit character. */ + + case OP_SCRIPT_RUN: + if (base_list[0] != OP_CHAR && base_list[0] != OP_CHARI) + return FALSE; + 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. */ @@ -614,7 +623,6 @@ for(;;) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: - return !entered_a_group; } @@ -1043,7 +1051,7 @@ for(;;) if (chr > 255) break; class_bitset = (uint8_t *) ((list_ptr == list ? code : base_end) - list_ptr[2]); - if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE; + if ((class_bitset[chr >> 3] & (1u << (chr & 7))) != 0) return FALSE; break; #ifdef SUPPORT_WIDE_CHARS |