Further reduce dependence on -fwrapv semantics in jsonb.
authorNathan Bossart
Fri, 16 Aug 2024 20:06:40 +0000 (15:06 -0500)
committerNathan Bossart
Fri, 16 Aug 2024 20:06:40 +0000 (15:06 -0500)
commit1d80d6b50e6401828fc445151375f9bde3f99ac6
treeaecc89ef6dd211959919dad9d2b23d1edce67f33
parentaa2d6b15d6d64564cb5b0d1c1e74fb64b29f41f1
Further reduce dependence on -fwrapv semantics in jsonb.

Commit 108d2adb9e missed updating a few places in the jsonb code
that rely on signed integer wrapping for correctness.  These can
also be fixed by using pg_abs_s32() to negate a signed integer
(that is known to be negative) for comparison with an unsigned
integer.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/bfff906f-300d-81ea-83b7-f2c93845e7f2%40gmail.com
src/backend/utils/adt/jsonfuncs.c