aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/regex/regc_nfa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/regex/regc_nfa.c b/src/backend/regex/regc_nfa.c
index 1a6c9ce1838..69929eddfcc 100644
--- a/src/backend/regex/regc_nfa.c
+++ b/src/backend/regex/regc_nfa.c
@@ -3082,8 +3082,13 @@ checkmatchall_recurse(struct nfa *nfa, struct state *s,
{
/* We found an all-RAINBOW path to the post state */
result = true;
+ /* ... which should not be adjacent to the pre state */
+ if (depth < 0)
+ {
+ NERR(REG_ASSERT);
+ return false;
+ }
/* Record potential match lengths */
- assert(depth >= 0);
hasmatch[depth] = true;
if (foundloop)
{