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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dcb314(at)hotmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ?
Date: 2025-09-26 14:53:26
Message-ID: 4059820.1758898406@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2025-09-26 17:02:38 Re: Postgres: Queries are too slow after upgrading to PG17 from PG15
Previous Message Anthony Sotolongo 2025-09-26 13:35:50 Re: BUG #19064: Trigger allows creation with invalid column references but fails at runtime