Skip to content

Commit

Permalink
Fix the correct size of memory block in bitmapinsert
Browse files Browse the repository at this point in the history
The field `hwords` of BMTIDBuffer is a fixed array, not variable.
  • Loading branch information
gfphoenix78 committed Jul 5, 2024
1 parent 63371e6 commit b570d12
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/backend/access/bitmap/bitmapinsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -2138,16 +2138,12 @@ insertsetbit(Relation rel, BlockNumber lovBlock, OffsetNumber lovOffset,
buf->last_word = lovItem->bm_last_word;
buf->is_last_compword_fill = (lovItem->lov_words_header >= 2);
buf->last_tid = lovItem->bm_last_setbit;
MemSet(buf->hwords, 0, BM_NUM_OF_HEADER_WORDS * sizeof(BM_HRL_WORD));
if (buf->cwords)
{
MemSet(buf->cwords, 0,
buf->num_cwords * sizeof(BM_HRL_WORD));
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
MemSet(buf->hwords, 0,
BM_CALC_H_WORDS(buf->num_cwords) * sizeof(BM_HRL_WORD));
#pragma GCC diagnostic pop
if (buf->last_tids)
MemSet(buf->last_tids, 0,
buf->num_cwords * sizeof(uint64));
Expand Down

0 comments on commit b570d12

Please sign in to comment.