diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-04-26 16:11:55 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-04-26 16:11:55 +0200 |
commit | 52eb4f172cc85bf2c9dcc515f747d9bd23089c65 (patch) | |
tree | 38b27016b279cc5982f99772bff5df1e981cfb93 /pcre/pcre_compile.c | |
parent | 1389c94b3c33793a3c7f56b5e238e29e7c71d998 (diff) | |
parent | 879f7e85aa08dda613ea2f481e53392da4864741 (diff) | |
download | mariadb-git-52eb4f172cc85bf2c9dcc515f747d9bd23089c65.tar.gz |
Merge branch 'merge-pcre' into 10.1
Diffstat (limited to 'pcre/pcre_compile.c')
-rw-r--r-- | pcre/pcre_compile.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c index 9b9da46f0d0..734875de2fb 100644 --- a/pcre/pcre_compile.c +++ b/pcre/pcre_compile.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2016 University of Cambridge + Copyright (c) 1997-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -3300,7 +3300,7 @@ for(;;) if ((*xclass_flags & XCL_MAP) == 0) { /* No bits are set for characters < 256. */ - if (list[1] == 0) return TRUE; + if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0; /* Might be an empty repeat. */ continue; } @@ -7645,6 +7645,8 @@ for (;; ptr++) /* Can't determine a first byte now */ if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE; + zerofirstchar = firstchar; + zerofirstcharflags = firstcharflags; continue; @@ -8685,10 +8687,18 @@ do { if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE; } - /* Positive forward assertions and conditions */ + /* Positive forward assertion */ - else if (op == OP_ASSERT || op == OP_COND) + else if (op == OP_ASSERT) + { + if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE; + } + + /* Condition; not anchored if no second branch */ + + else if (op == OP_COND) { + if (scode[GET(scode,1)] != OP_ALT) return FALSE; if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE; } |