Re: BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ?
Date
Msg-id 4059820.1758898406@sss.pgh.pa.us
Whole thread Raw
In response to BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ?  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> Static analyser cppcheck says:

> postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86:22: style: Array
> index 'j' is used before limits check. [arrayIndexThenCheck]

Did your static analyzer not notice that this dead code is
not even compiled?  I don't have a lot of faith in analyzers
that ignore #ifdefs.

(It's fair to ask why we haven't removed this code altogether
... laziness I guess, or waiting for something better than
GEQO to come along.  But expending effort on fixing it
is definitely not in the cards.)

            regards, tom lane



pgsql-bugs by date:

Previous
From: Anthony Sotolongo
Date:
Subject: Re: BUG #19064: Trigger allows creation with invalid column references but fails at runtime
Next
From: Peter Geoghegan
Date:
Subject: Re: Postgres: Queries are too slow after upgrading to PG17 from PG15