diff options
Diffstat (limited to 'thirdparty/pcre2/src/pcre2_study.c')
-rw-r--r-- | thirdparty/pcre2/src/pcre2_study.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/thirdparty/pcre2/src/pcre2_study.c b/thirdparty/pcre2/src/pcre2_study.c index acbf98b41b..e883c2eb4c 100644 --- a/thirdparty/pcre2/src/pcre2_study.c +++ b/thirdparty/pcre2/src/pcre2_study.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 @@ -54,7 +54,7 @@ collecting data (e.g. minimum matching length). */ /* Set a bit in the starting code unit bit map. */ -#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1 << ((c)&7)) +#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1u << ((c)&7)) /* Returns from set_start_bits() */ @@ -171,6 +171,7 @@ for (;;) /* Fall through */ case OP_ONCE: + case OP_SCRIPT_RUN: case OP_SBRA: case OP_BRAPOS: case OP_SBRAPOS: @@ -842,7 +843,7 @@ for (c = 0; c < table_limit; c++) if (table_limit == 32) return; for (c = 128; c < 256; c++) { - if ((re->tables[cbits_offset + c/8] & (1 << (c&7))) != 0) + if ((re->tables[cbits_offset + c/8] & (1u << (c&7))) != 0) { PCRE2_UCHAR buff[6]; (void)PRIV(ord2utf)(c, buff); @@ -1075,6 +1076,7 @@ do case OP_CBRAPOS: case OP_SCBRAPOS: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_ASSERT: rc = set_start_bits(re, tcode, utf); if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc; @@ -1505,11 +1507,11 @@ do for (c = 0; c < 16; c++) re->start_bitmap[c] |= classmap[c]; for (c = 128; c < 256; c++) { - if ((classmap[c/8] & (1 << (c&7))) != 0) + if ((classmap[c/8] & (1u << (c&7))) != 0) { - int d = (c >> 6) | 0xc0; /* Set bit for this starter */ - re->start_bitmap[d/8] |= (1 << (d&7)); /* and then skip on to the */ - c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ + int d = (c >> 6) | 0xc0; /* Set bit for this starter */ + re->start_bitmap[d/8] |= (1u << (d&7)); /* and then skip on to the */ + c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ } } } |