forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit58666ed
committed
Fix latent portability issue in pgwin32_dispatch_queued_signals().
The first iteration of the signal-checking loop would compute sigmask(0)which expands to 1<<(-1) which is undefined behavior according to theC standard. The lack of field reports of trouble suggest that itevaluates to 0 on all existing Windows compilers, but that's hardlysomething to rely on. Since signal 0 isn't a queueable signal anyway,we can just make the loop iterate from 1 instead, and save a few cyclesas well as avoiding the undefined behavior.In passing, avoid evaluating the volatile expression UNBLOCKED_SIGNAL_QUEUEtwice in a row; there's no reason to waste cycles like that.Noted by Aleksander Alekseev, though this isn't his proposed fix.Back-patch to all supported branches.1 parenteb7308d commit58666ed
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
| |||
105 | 106 |
| |
106 | 107 |
| |
107 | 108 |
| |
108 |
| - | |
| 109 | + | |
109 | 110 |
| |
110 | 111 |
| |
111 |
| - | |
| 112 | + | |
112 | 113 |
| |
113 | 114 |
| |
114 |
| - | |
| 115 | + | |
115 | 116 |
| |
116 |
| - | |
| 117 | + | |
117 | 118 |
| |
118 | 119 |
| |
119 | 120 |
| |
|
0 commit comments
Comments
(0)