forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita235b85
committed
Fix the int8 and int2 cases of (minimum possible integer) % (-1).
The correct answer for this (or any other case with arg2 = -1) is zero,but some machines throw a floating-point exception instead of behavingsanely. Commitf9ac414 dealt with thisin int4mod, but overlooked the fact that it also happens in int8mod(at least on my Linux x86_64 machine). Protect int2mod as well; it'snot clear whether any machines fail there (mine does not) but since thetest is so cheap it seems better safe than sorry. While at it, simplifythe original guard in int4mod: we need only check for arg2 == -1, wedon't need to check arg1 explicitly.Xi Wang, with some editing by me.1 parentdec10ba commita235b85
2 files changed
+23
-2
lines changedLines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1095 | 1095 |
| |
1096 | 1096 |
| |
1097 | 1097 |
| |
1098 |
| - | |
1099 |
| - | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1100 | 1104 |
| |
1101 | 1105 |
| |
1102 | 1106 |
| |
| |||
1119 | 1123 |
| |
1120 | 1124 |
| |
1121 | 1125 |
| |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1122 | 1135 |
| |
1123 | 1136 |
| |
1124 | 1137 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
649 | 649 |
| |
650 | 650 |
| |
651 | 651 |
| |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
652 | 660 |
| |
653 | 661 |
| |
654 | 662 |
| |
|
0 commit comments
Comments
(0)