Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior
Date: 2020-08-27 17:05:30
Message-ID: CAEudQApY-MOzuSykmNeoFcJCpQXdUXS6mfFPtZnTDJLrC-Yk_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui., 27 de ago. de 2020 às 13:57, Alvaro Herrera <
alvherre(at)2ndquadrant(dot)com> escreveu:

> On 2020-Aug-27, Ranier Vilela wrote:
>
> > indexcmds.c (1162):
> > memcpy(part_oids, partdesc->oids, sizeof(Oid) * nparts);
>
> Looks legit, and at least per commit 13bba02271dc we do fix such things,
> even if it's useless in practice.
>
> Given that no buildfarm member has ever complained, this exercise seems
> pretty pointless.
>
Hi Álvaro,
If we are passing a null pointer in these places and it should not be done,
it is a sign that perhaps these calls should not or should not be made, and
they can be avoided.
This would eliminate undefined behavior and save some cycles?

regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2020-08-27 17:07:34 Re: Deprecating postfix and factorial operators in PostgreSQL 13
Previous Message Alvaro Herrera 2020-08-27 16:57:20 Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior