- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitb3fade5
committed
Fix overflow handling in plpgsql's integer FOR loops.
The test to exit the loop if the integer control value would overflowan int32 turns out not to work on some ICC versions, as it's dependenton the assumption that the compiler will execute the code as writtenrather than "optimize" it. ICC lacks any equivalent of gcc's -fwrapvswitch, so it was optimizing on the assumption of no integer overflow,and that breaks this. Rewrite into a form that in fact does notdo any overflowing computations.Per Tomas Vondra and buildfarm member fulmar. It's been like thisfor a long time, although it was not till we added a regression testcase covering the behavior (in commitdd2243f) that the problembecame apparent. Back-patch to all supported versions.Discussion:https://postgr.es/m/50562fdc-0876-9843-c883-15b8566c7511@2ndquadrant.com1 parent7de7ddb commitb3fade5
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2118 | 2118 |
| |
2119 | 2119 |
| |
2120 | 2120 |
| |
2121 |
| - | |
| 2121 | + | |
2122 | 2122 |
| |
2123 | 2123 |
| |
2124 | 2124 |
| |
2125 | 2125 |
| |
2126 | 2126 |
| |
2127 |
| - | |
| 2127 | + | |
2128 | 2128 |
| |
2129 | 2129 |
| |
2130 | 2130 |
| |
|
0 commit comments
Comments
(0)