1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00
Files
postgres/src
Tom Lane 3352e25e85 Improve handling of INT_MIN / -1 and related cases.
Some platforms throw an exception for this division, rather than returning
a necessarily-overflowed result.  Since we were testing for overflow after
the fact, an exception isn't nice.  We can avoid the problem by treating
division by -1 as negation.

Add some regression tests so that we'll find out if any compilers try to
optimize away the overflow check conditions.

Back-patch of commit 1f7cb5c309.

Per discussion with Xi Wang, though this is different from the patch he
submitted.
2012-11-19 21:22:00 -05:00
..
2012-09-19 17:58:37 -04:00
2006-07-10 15:50:02 +00:00