Re: BUG #18248: Expression is always zero - Mailing list pgsql-bugs

From Julien Rouhaud
Subject Re: BUG #18248: Expression is always zero
Date
Msg-id ZXrirGsvtY3PnlfB@jrouhaud
Whole thread Raw
In response to BUG #18248: Expression is always zero  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18248: Expression is always zero
List pgsql-bugs
Hi,

On Thu, Dec 14, 2023 at 05:32:49AM +0000, PG Bug reporting form wrote:
>
> The value of expression 'thistimecnt >> 31 >> 31 >> 2' (in
> src/timezone/zic.c) is zero regardless of the value of the left operand
> 'thistimecnt', because it is shifted by 64 (in total) bits, which is greater
> or equal to its size of 64 bits.
>
> Maybe this was what was meant?
> thistimecnt >> 31 >> 2

Note that this is code imported as-is from upstream IANA tzcode, so we wouldn't
make any change ourself.

Looking at their git history they added it to remove some theoretical int
limits:
https://github.com/eggert/tz/commit/cc8aec6ecb1ecc3099f173e2bca9785ae8359c03



pgsql-bugs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: BUG #18248: Expression is always zero
Next
From: Alexander Lakhin
Date:
Subject: Re: BUG #18248: Expression is always zero