Re: [PATCH] Avoid signed overflow in bms_prev_member assertion

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Lev Nikolaev <lev(dot)nikolaev(at)tantorlabs(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Avoid signed overflow in bms_prev_member assertion
Date: 2026-08-25 08:17:33
Message-ID: CAApHDvr30bhUdkw9tth_UVvf-U+rtDFH_h0=y72vF+Mb-nHtkQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 25 Aug 2026 at 19:02, Lev Nikolaev <lev(dot)nikolaev(at)tantorlabs(dot)com> wrote:
> I noticed that the range assertion in bms_prev_member() performs the
> multiplication in signed int arithmetic before converting its result to
> unsigned int:
>
> (unsigned int) (a->nwords * BITS_PER_BITMAPWORD)

Fixed.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-08-25 08:18:37 Re: Tracking per-RelOptInfo uniqueness during planning
Previous Message Daniel Gustafsson 2026-08-25 08:16:41 Re: Replace px_memset() with explicit_bzero()