diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-11-19 21:21:48 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-11-19 21:21:48 -0500 |
| commit | eb865dbb1b0dd2f78c5f516ce2b003d183207d2c (patch) | |
| tree | 8bab9d4b1c4507d3c97807f938d5911064e4ab27 /src/backend/utils/time | |
| parent | 15939a7a2903604596c05e633c893aba43a68ad0 (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 'src/backend/utils/time')
0 files changed, 0 insertions, 0 deletions
