forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2e06d52
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 parent797ea52 commit2e06d52
2 files changed
+23
-2
lines changedLines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1094 | 1094 |
| |
1095 | 1095 |
| |
1096 | 1096 |
| |
1097 |
| - | |
1098 |
| - | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1099 | 1103 |
| |
1100 | 1104 |
| |
1101 | 1105 |
| |
| |||
1118 | 1122 |
| |
1119 | 1123 |
| |
1120 | 1124 |
| |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1121 | 1134 |
| |
1122 | 1135 |
| |
1123 | 1136 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
651 | 651 |
| |
652 | 652 |
| |
653 | 653 |
| |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
654 | 662 |
| |
655 | 663 |
| |
656 | 664 |
| |
|
0 commit comments
Comments
(0)