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
1 changed files with 6 additions and 2 deletions

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;