forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit04c76ac
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 parentee7bf0f commit04c76ac
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2201 | 2201 |
| |
2202 | 2202 |
| |
2203 | 2203 |
| |
2204 |
| - | |
| 2204 | + | |
2205 | 2205 |
| |
2206 | 2206 |
| |
2207 | 2207 |
| |
2208 | 2208 |
| |
2209 | 2209 |
| |
2210 |
| - | |
| 2210 | + | |
2211 | 2211 |
| |
2212 | 2212 |
| |
2213 | 2213 |
| |
|
0 commit comments
Comments
(0)