- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5917297
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 parent12d18b4 commit5917297
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2068 | 2068 |
| |
2069 | 2069 |
| |
2070 | 2070 |
| |
2071 |
| - | |
| 2071 | + | |
2072 | 2072 |
| |
2073 | 2073 |
| |
2074 | 2074 |
| |
2075 | 2075 |
| |
2076 | 2076 |
| |
2077 |
| - | |
| 2077 | + | |
2078 | 2078 |
| |
2079 | 2079 |
| |
2080 | 2080 |
| |
|
0 commit comments
Comments
(0)