pgsql: Fix portability issue in new jsonbsubs code.

Started by Tom Laneover 5 years ago2 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Fix portability issue in new jsonbsubs code.

On machines where sizeof(Datum) > sizeof(Oid) (that is, any 64-bit
platform), the previous coding would compute a misaligned
workspace->index pointer if nupper is odd. Architectures where
misaligned access is a hard no-no would then fail. This appears
to explain why thorntail is unhappy but other buildfarm members
are not.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7c5d57caed4d8af705d0cc3131d0d8ed72b7a41d

Modified Files
--------------
src/backend/utils/adt/jsonbsubs.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

#2Alexander Korotkov
aekorotkov@gmail.com
In reply to: Tom Lane (#1)
Re: pgsql: Fix portability issue in new jsonbsubs code.

On Mon, Feb 1, 2021 at 10:04 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Fix portability issue in new jsonbsubs code.

On machines where sizeof(Datum) > sizeof(Oid) (that is, any 64-bit
platform), the previous coding would compute a misaligned
workspace->index pointer if nupper is odd. Architectures where
misaligned access is a hard no-no would then fail. This appears
to explain why thorntail is unhappy but other buildfarm members
are not.

Thank you for fixing this!

------
Regards,
Alexander Korotkov