Re: Undefined behavior detected by new clang's ubsan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Undefined behavior detected by new clang's ubsan
Date
Msg-id 1710697.1768935128@sss.pgh.pa.us
Whole thread Raw
In response to Re: Undefined behavior detected by new clang's ubsan  (John Naylor <johncnaylorls@gmail.com>)
Responses Re: Undefined behavior detected by new clang's ubsan
List pgsql-hackers
John Naylor <johncnaylorls@gmail.com> writes:
> I don't think it's great to pass a NULL pointer to a sort, but the
> length could conceivably be zero for future degenerate cases, so we
> could silence the warning by adding "if (n < 2) return;" before the
> for-loop. The advantage of doing that anyway is it allows us to remove
> all four of the "if (d_ > ST_POINTER_STEP)" branches in the recursion
> part. That's better for readability.

+1

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Matheus Alcantara"
Date:
Subject: Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint
Next
From: Tom Lane
Date:
Subject: Re: commented out code