git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: a7db71e) | patch
Fix corner-case 64-bit integer subtraction bug on some platforms.
Thu, 9 Nov 2023 09:50:23 +0000 (09:50 +0000)
Thu, 9 Nov 2023 09:50:23 +0000 (09:50 +0000)
commit 0e3e8fbd3a8b1660b02a5bb032dc1f50e1d66b19
Fix corner-case 64-bit integer subtraction bug on some platforms.

When computing "0 - INT64_MIN", most platforms would report an
overflow error, which is correct. However, platforms without integer
overflow builtins or 128-bit integers would fail to spot the overflow,
and incorrectly return INT64_MIN.

Back-patch to all supported branches.

Patch be me. Thanks to Jian He for initial investigation, and Laurenz
Albe and Tom Lane for review.

Discussion: https://postgr.es/m/CAEZATCUNK-AZSD0jVdgkk0N%3DNcAXBWeAEX-QU9AnJPensikmdQ%40mail.gmail.com
src/include/common/int.h diff | blob | blame | history
src/test/regress/expected/int8.out diff | blob | blame | history
src/test/regress/sql/int8.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /