Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3db05e7

Browse files
committed
Suppress compiler warning in new regex match-all detection code.
gcc 10 is smart enough to notice that control could reach this"hasmatch[depth]" assignment with depth < 0, but not smart enoughto know that that would require a badly broken NFA graph. Changethe assert() to a plain runtime test to shut it up.Per report from Andres Freund.Discussion:https://postgr.es/m/20210223173437.b3ywijygsy6q42gq@alap3.anarazel.de
1 parentd9d0762 commit3db05e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/backend/regex/regc_nfa.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3082,8 +3082,13 @@ checkmatchall_recurse(struct nfa *nfa, struct state *s,
30823082
{
30833083
/* We found an all-RAINBOW path to the post state */
30843084
result= true;
3085+
/* ... which should not be adjacent to the pre state */
3086+
if (depth<0)
3087+
{
3088+
NERR(REG_ASSERT);
3089+
return false;
3090+
}
30853091
/* Record potential match lengths */
3086-
assert(depth >=0);
30873092
hasmatch[depth]= true;
30883093
if (foundloop)
30893094
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp