BUG #18993: [BUG] Unreachable code in pg_next_dst_boundary()

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: gorcom2012(at)gmail(dot)com
Subject: BUG #18993: [BUG] Unreachable code in pg_next_dst_boundary()
Date: 2025-07-21 12:29:16
Message-ID: 18993-fd78c35834306695@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18993
Logged by: Eugeny Goryachev
Email address: gorcom2012(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Nathan Bossart 2025-07-21 14:29:32 Re: BUG #18993: [BUG] Unreachable code in pg_next_dst_boundary()
Previous Message Rahila Syed 2025-07-21 07:21:14 Re: BUG #18992: Autovacuum triggering assert - LWLockAnyHeldByMe