Dubious coding in nbtinsert.c - Mailing list pgsql-hackers

From Tom Lane
Subject Dubious coding in nbtinsert.c
Date
Msg-id 1922884.1617909599@sss.pgh.pa.us
Whole thread Raw
Responses Re: Dubious coding in nbtinsert.c  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
Buildfarm member curculio, which doesn't usually produce
uninitialized-variable warnings, is showing one here:

nbtinsert.c: In function '_bt_doinsert':
nbtinsert.c:411: warning: 'curitemid' may be used uninitialized in this function
nbtinsert.c:411: note: 'curitemid' was declared here

I can see its point: curitemid is set only if !inposting.
While the first two uses of the value are clearly reached
only if !inposting, it's FAR from clear that it's impossible
to reach "ItemIdMarkDead(curitemid);" without a valid value.
Could you clean that up?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: multi-install PostgresNode fails with older postgres versions
Next
From: Peter Geoghegan
Date:
Subject: Re: Dubious coding in nbtinsert.c