pgsql: Remove no-longer-helpful reliance on fixed-size local array.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove no-longer-helpful reliance on fixed-size local array.
Date: 2019-07-21 15:42:16
Message-ID: E1hpDya-0003oR-SC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove no-longer-helpful reliance on fixed-size local array.

Coverity complained about this code, apparently because it uses a local
array of size FUNC_MAX_ARGS without a guard that the input argument list
is no longer than that. (Not sure why it complained today, since this
code's been the same for a long time; possibly it re-analyzed everything
the List API change touched?)

Rather than add a guard, though, let's just get rid of the local array
altogether. It was only there to avoid list_nth() calls, and those are
no longer expensive.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/330cafdfaa11ebe53e3e59688acac1577ae0cb34

Modified Files
--------------
src/backend/parser/parse_func.c | 60 ++++++++++++++++-------------------------
1 file changed, 23 insertions(+), 37 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2019-07-21 22:30:13 pgsql: Adjust overly strict Assert
Previous Message Michael Paquier 2019-07-21 13:38:30 pgsql: Fix compilation warning of pg_basebackup with MinGW