Re: Assignment before assert

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assignment before assert
Date: 2025-02-13 23:15:40
Message-ID: C0DAA79C-1405-455E-BD73-0FC6134FEE6D@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 13 Feb 2025, at 18:08, Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru> wrote:
>
> Hi!
> Function EvalPlanQualFetchRowMark contains an assignment
>
> ExecRowMark *erm = earm->rowmark;
>
> before assert
>
> Assert(earm != NULL);
>
> Maybe these lines need to be swapped?

That does admittedly look a bit odd, that assertion can't be reached if earm is
null since we've already dereferenced it by then. I'll have another look after
coffee but something along the lines of your patch looks right (or just remove
the Assertion perhaps).

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-02-13 23:25:46 Re: dblink: Add SCRAM pass-through authentication
Previous Message Melanie Plageman 2025-02-13 23:11:31 Re: Confine vacuum skip logic to lazy_scan_skip