diff options
author | Tom Lane | 2012-11-20 02:21:54 +0000 |
---|---|---|
committer | Tom Lane | 2012-11-20 02:21:54 +0000 |
commit | 9e74c02259f4bdd77a35c2e2547fd78a8ec41552 (patch) | |
tree | 29ad7c4b8ea7dcdbebcbcfe1e2059af3d7045f64 /doc/src | |
parent | 73af46e82c501ec9122fd27c39c709f1d6fecc17 (diff) |
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 1f7cb5c30983752ff8de833de30afcaee63536d0.
Per discussion with Xi Wang, though this is different from the patch he
submitted.
Diffstat (limited to 'doc/src')
0 files changed, 0 insertions, 0 deletions