1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Fix alignment of stack variable

Declare with union similar to PGAlignedBlock.

Report and fix by Andres Freund

Discussion: https://postgr.es/m/20240407190731.izm3mdazednrsiqk%40awork3.anarazel.de
This commit is contained in:
John Naylor
2024-04-08 10:40:20 +07:00
parent 304b6b1a6b
commit 0ea51bac38

View File

@ -303,8 +303,12 @@ void
TidStoreSetBlockOffsets(TidStore *ts, BlockNumber blkno, OffsetNumber *offsets,
int num_offsets)
{
char data[MaxBlocktableEntrySize];
BlocktableEntry *page = (BlocktableEntry *) data;
union
{
char data[MaxBlocktableEntrySize];
BlocktableEntry force_align_entry;
} data;
BlocktableEntry *page = (BlocktableEntry *) data.data;
bitmapword word;
int wordnum;
int next_word_threshold;