From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dcb314@hotmail.com
Subject: BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ?
Date: Fri, 26 Sep 2025 09:51:09 +0000
Message-ID: <19066-53bfa81d53f11b75@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19066
Logged by: David Binderman
Email address: dcb314@hotmail.com
PostgreSQL version: 18.0
Operating system: fedora 42
Description:
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]
Source code is
while ((city_table[j].select_list == -1) && (j < num_gene))
Suggest new source code
while ((j < num_gene) && (city_table[j].select_list == -1))
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dcb314@hotmail.com
Subject: Re: BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ?
In-Reply-To: <19066-53bfa81d53f11b75@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox