pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Dmitry Koval <d.koval@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Assignment before assert
Date: Fri, 14 Feb 2025 14:44:40 +0900
Message-ID: <Z67YSMqd2dsJz5Sd@paquier.xyz> (raw)
In-Reply-To: <C0DAA79C-1405-455E-BD73-0FC6134FEE6D@yesql.se>
References: <1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru>
	<C0DAA79C-1405-455E-BD73-0FC6134FEE6D@yesql.se>

On Fri, Feb 14, 2025 at 12:15:40AM +0100, Daniel Gustafsson wrote:
> > 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).

Accessing earm->rowmark is one thing, assuming that earm should never
be NULL is a different one.  Looking at 27cc7cd2bc8a that has
introduced this assertion, the proposed patch makes sense to me.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (4+ messages)  latest in thread

Message-ID: <Z67YSMqd2dsJz5Sd@paquier.xyz>
Permalink:  ../Z67YSMqd2dsJz5Sd@paquier.xyz/
Also on:    postgresql.org/message-id/Z67YSMqd2dsJz5Sd@paquier.xyz

 · 

reply

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-hackers@postgresql.org
  Cc: michael@paquier.xyz, daniel@yesql.se, d.koval@postgrespro.ru
  Subject: Re: Assignment before assert
  In-Reply-To: <Z67YSMqd2dsJz5Sd@paquier.xyz>

* 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