forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit03a37e9
committed
Fix volatile-safety issue in asyncQueueReadAllNotifications().
The "pos" variable is modified within PG_TRY and then referencedwithin PG_CATCH, so for strict POSIX conformance it must be markedvolatile. Superficially the code looked safe because pos's addresswas taken, which was sufficient to force it into memory ... but it'snot sufficient to ensure that the compiler applies updates exactlywhere the program text says to. The volatility marking has to extendinto a couple of subroutines too, but I think that's probably a goodthing because the risk of out-of-order updates is mostly in thosesubroutines not asyncQueueReadAllNotifications() itself. In principlethe compiler could have re-ordered operations such that an error couldbe thrown while "pos" had an incorrect value.It's unclear how real the risk is here, but for safety back-patchto all active branches.1 parentb00a088 commit03a37e9
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
371 | 371 |
| |
372 | 372 |
| |
373 | 373 |
| |
374 |
| - | |
| 374 | + | |
375 | 375 |
| |
376 | 376 |
| |
377 | 377 |
| |
378 | 378 |
| |
379 | 379 |
| |
380 |
| - | |
| 380 | + | |
381 | 381 |
| |
382 | 382 |
| |
383 | 383 |
| |
| |||
1225 | 1225 |
| |
1226 | 1226 |
| |
1227 | 1227 |
| |
1228 |
| - | |
| 1228 | + | |
1229 | 1229 |
| |
1230 | 1230 |
| |
1231 | 1231 |
| |
| |||
1815 | 1815 |
| |
1816 | 1816 |
| |
1817 | 1817 |
| |
1818 |
| - | |
| 1818 | + | |
1819 | 1819 |
| |
1820 | 1820 |
| |
1821 | 1821 |
| |
| |||
1975 | 1975 |
| |
1976 | 1976 |
| |
1977 | 1977 |
| |
1978 |
| - | |
| 1978 | + | |
1979 | 1979 |
| |
1980 | 1980 |
| |
1981 | 1981 |
| |
|
0 commit comments
Comments
(0)