From: Tom Lane <tgl@sss.pgh.pa.us>
To: rekgrpth@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM
Date: Thu, 07 Dec 2023 09:30:45 -0500
Message-ID: <1267887.1701959445@sss.pgh.pa.us> (raw)
In-Reply-To: <18232-27836d653eddfa97@postgresql.org>
References: <18232-27836d653eddfa97@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY,
> WJB_VALUE and WJB_ELEM
> So I can call pushJsonbValue(NULL, WJB_VALUE, NULL) and get Segmentation
> fault
What's your point? If we did have such Asserts, the process would
still crash if you did that.
In general I don't find a lot of value in Assert'ing that a pointer
isn't null in code that is about to dereference it. You'll get a
clearly-interpretable process crash either way, so an Assert seems
like useless code bloat. Others might have a different opinion,
but surely this is a matter of style not a bug. We've not chosen
to have any particular project style on this point.
regards, tom lane
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: tgl@sss.pgh.pa.us, rekgrpth@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM
In-Reply-To: <1267887.1701959445@sss.pgh.pa.us>
* 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