diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-04-26 12:25:09 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-04-26 12:25:09 +0200 |
commit | 879f7e85aa08dda613ea2f481e53392da4864741 (patch) | |
tree | 4c80f89f6db2fbf5b8279453648aa279a19e2db0 /pcre/pcre_compile.c | |
parent | cf242aded51f1e1fb53b75911ab7e4da3af37eb4 (diff) | |
download | mariadb-git-879f7e85aa08dda613ea2f481e53392da4864741.tar.gz |
8.43
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 6dd88860638..079d30aa668 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 @@ -3299,7 +3299,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; } @@ -7642,6 +7642,8 @@ for (;; ptr++) /* Can't determine a first byte now */ if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE; + zerofirstchar = firstchar; + zerofirstcharflags = firstcharflags; continue; @@ -8682,10 +8684,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; } |