Skip to content

Commit d68aede

Browse files
authored
Fix the correct size of memory block in bitmapinsert (#495)
The field `hwords` of BMTIDBuffer is a fixed array, not variable.
1 parent cfd2ce4 commit d68aede

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/backend/access/bitmap/bitmapinsert.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,16 +2138,12 @@ insertsetbit(Relation rel, BlockNumber lovBlock, OffsetNumber lovOffset,
21382138
buf->last_word = lovItem->bm_last_word;
21392139
buf->is_last_compword_fill = (lovItem->lov_words_header >= 2);
21402140
buf->last_tid = lovItem->bm_last_setbit;
2141+
MemSet(buf->hwords, 0, BM_NUM_OF_HEADER_WORDS * sizeof(BM_HRL_WORD));
21412142
if (buf->cwords)
21422143
{
21432144
MemSet(buf->cwords, 0,
21442145
buf->num_cwords * sizeof(BM_HRL_WORD));
21452146
}
2146-
#pragma GCC diagnostic push
2147-
#pragma GCC diagnostic ignored "-Warray-bounds"
2148-
MemSet(buf->hwords, 0,
2149-
BM_CALC_H_WORDS(buf->num_cwords) * sizeof(BM_HRL_WORD));
2150-
#pragma GCC diagnostic pop
21512147
if (buf->last_tids)
21522148
MemSet(buf->last_tids, 0,
21532149
buf->num_cwords * sizeof(uint64));

0 commit comments

Comments
 (0)