Thanks for looking.
On Tue, 14 Apr 2026 at 20:46, Chao Li <li.evan.chao@gmail.com> wrote:
> + if (((uint64) new_nwords - 1) * BITS_PER_BITMAPWORD + high_bit + offset_bits > PG_INT32_MAX)
> + elog(ERROR, "bitmapset overflow");
> This overflow check seems wrong. Because when high_bit + offset_bits > BITS_PER_BITMAPWORD, new_nwords has been
increasedby 1, so there high_bit + offset_bits are double counted.
Your idea of checking the old highest member plus the offset seems a
more robust method, so I've adjusted the patch to use that.
David