pgsql: Add more pg_attribute_counted_by() to various flexible array mem

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add more pg_attribute_counted_by() to various flexible array mem
Date: 2026-11-02 10:44:41
Message-ID: E1xNpWr-00000001mSk-2uEO@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add more pg_attribute_counted_by() to various flexible array members

Annotate flexible array members whose element count is held by another
member of the same struct, so that the compiler knows the real extent
of these arrays.

This continues the work from commit 7a04cac0c3b. In one case, the
order of assignments to the counted and counting fields had to be
adjusted.

Extension code could in theory be affected by the new annotations in
the header files, but it is mostly unlikely that extensions would
build or resize these structs themselves, and in any case a violation
would show up as a new warning or sanitizer failure, not silent
breakage.

Author: Tristan Partin <tristan(at)partin(dot)io>
Reviewed-by: Japin Li <japinli(at)hotmail(dot)com>
Reviewed-by: Greg Burd <greg(at)burd(dot)me>
Reviewed-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Discussion: https://www.postgresql.org/message-id/flat/DKBEBF32QLUA.3L2DJRPUYNKHZ%40partin.io

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/633dee1bd1b41145f81619423d573754c7ad2b9e

Modified Files
--------------
src/backend/executor/execParallel.c | 2 +-
src/backend/nodes/bitmapset.c | 4 ++--
src/include/access/brin_internal.h | 2 +-
src/include/access/tupdesc.h | 2 +-
src/include/executor/execPartition.h | 4 ++--
src/include/executor/instrument.h | 2 +-
src/include/executor/instrument_node.h | 20 ++++++++++----------
src/include/jit/jit.h | 2 +-
src/include/nodes/bitmapset.h | 2 +-
src/include/regex/regguts.h | 4 ++--
src/include/statistics/extended_stats_internal.h | 2 +-
src/include/statistics/statistics.h | 8 ++++----
src/include/tsearch/dicts/spell.h | 2 +-
src/include/utils/catcache.h | 2 +-
src/include/utils/datetime.h | 2 +-
src/pl/plpython/plpy_procedure.h | 2 +-
16 files changed, 31 insertions(+), 31 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2026-11-02 16:15:06 pgsql: Fix missing tts_tid assignments in ExecForceStoreHeapTuple().
Previous Message Richard Guo 2026-11-02 06:43:59 pgsql: Update .abi-compliance-history for hashed SubPlan fix