From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: gorcom2012@gmail.com
Subject: BUG #18993: [BUG] Unreachable code in pg_next_dst_boundary()
Date: Mon, 21 Jul 2025 12:29:16 +0000
Message-ID: <18993-fd78c35834306695@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18993
Logged by: Eugeny Goryachev
Email address: gorcom2012@gmail.com
PostgreSQL version: 17.4
Operating system: Ubuntu
Description:
Hello,
In pg_next_dst_boundary() (src/timezone/localtime.c), the following
condition can never be true:
```
if (tcycles - icycles >= 1 || icycles - tcycles >= 1)
return -1;
```
This is unreachable because icycles is assigned directly from tcycles.
Suggested fix:
Remove this condition entirely
The change is safe as it only removes dead code. All timezone transition
cases are already properly handled by other paths.
Best regards, Eugeny Goryachev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, gorcom2012@gmail.com
Subject: Re: BUG #18993: [BUG] Unreachable code in pg_next_dst_boundary()
In-Reply-To: <18993-fd78c35834306695@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox