Re: Assignment before assert - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Assignment before assert
Date
Msg-id C0DAA79C-1405-455E-BD73-0FC6134FEE6D@yesql.se
Whole thread Raw
List pgsql-hackers
> On 13 Feb 2025, at 18:08, Dmitry Koval <d.koval@postgrespro.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




pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: pg_stat_statements and "IN" conditions
Next
From: Jacob Champion
Date:
Subject: Re: dblink: Add SCRAM pass-through authentication