pgsql: Initialize HASHCTL differently, to suppress Coverity warning

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Initialize HASHCTL differently, to suppress Coverity warning
Date: 2024-08-11 17:22:08
Message-ID: E1sdCGe-003jcV-Fm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Initialize HASHCTL differently, to suppress Coverity warning

Coverity complained that the hash_create() call might access
hash_table_ctl->hctl. That's a false alarm, hash_create() only
accesses that field when passed the HASH_SHARED_MEM flag. Try to
silence it by using a plain local variable instead of a const. That's
how the HASHCTL is initialized in all the other hash_create() calls.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f011e82c2c886329245f821146c560a3607f7aba

Modified Files
--------------
src/backend/access/transam/xlogprefetcher.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2024-08-11 19:43:30 pgsql: Avoid unneeded nbtree backwards scan buffer locks.
Previous Message Tom Lane 2024-08-11 16:25:07 pgsql: Suppress Coverity warnings about Asserts in get_name_for_var_fie