forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit46c79df
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 parentc027d84 commit46c79df
2 files changed
+23
-2
lines changedLines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1083 | 1083 |
| |
1084 | 1084 |
| |
1085 | 1085 |
| |
1086 |
| - | |
1087 |
| - | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
1088 | 1092 |
| |
1089 | 1093 |
| |
1090 | 1094 |
| |
| |||
1107 | 1111 |
| |
1108 | 1112 |
| |
1109 | 1113 |
| |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1110 | 1123 |
| |
1111 | 1124 |
| |
1112 | 1125 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
657 | 657 |
| |
658 | 658 |
| |
659 | 659 |
| |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
660 | 668 |
| |
661 | 669 |
| |
662 | 670 |
| |
|
0 commit comments
Comments
(0)