Re: postgresql-10.0/src/backend/optimizer/geqo/geqo_ox2.c:84:sanity check after use ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Binderman <dcb314(at)hotmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: postgresql-10.0/src/backend/optimizer/geqo/geqo_ox2.c:84:sanity check after use ?
Date: 2017-10-06 16:40:04
Message-ID: 9087.1507308004@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Binderman <dcb314(at)hotmail(dot)com> writes:
> postgresql-10.0/src/backend/optimizer/geqo/geqo_ox2.c:84]: (style) Array index 'j' is used before limits check.

Hmm, this code is ifdef'd out as of v10, so I'm not sure why your
tool paid any attention to it.

Since it's not used, and hasn't been used in decades, and has got more
bugs than just this stylistic one (in particular, even if we fixed that
innermost loop, the next line would still access the undefined select_list
value; plus I think it will fail badly in the event that the "make a list
of selected cities" loop picks the same "pos" more than once),
I'm disinclined to spend any effort on fixing it.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Hans Buschmann 2017-10-06 16:50:31 Re: BUG #14844: Failure/Duplicate key value with ALTER DATABASE set search_path
Previous Message Tom Lane 2017-10-06 15:52:59 Re: postgresql-10.0/src/backend/access/transam/clog.c:234: sanity check after use ?