forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita7e5237
committed
Fix asserts in fast-path locking code
Commitc4d5cb7 introduced a couple asserts in the fast-path lockingcode, upsetting Coverity.The assert in InitProcGlobal() is clearly wrong, as it assigns insteadof checking the value. This is harmless, but doesn't check anything.The asserts in FAST_PATH_ macros are written as if for signed values,but the macros are only called for unsigned ones. That makes the checkfor (val >= 0) useless. Checks written as ((uint32) x < max) work forboth signed and unsigned values. Negative values should wrap to valuesgreater than INT32_MAX.Per Coverity, report by Tom Lane.Reported-by: Tom LaneDiscussion:https://postgr.es/m/2891628.1727019959@sss.pgh.pa.us1 parent40708ac commita7e5237
2 files changed
+5
-5
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
221 |
| - | |
222 |
| - | |
| 221 | + | |
| 222 | + | |
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 | 227 |
| |
228 | 228 |
| |
229 | 229 |
| |
230 |
| - | |
| 230 | + | |
231 | 231 |
| |
232 | 232 |
| |
233 |
| - | |
| 233 | + | |
234 | 234 |
| |
235 | 235 |
| |
236 | 236 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
322 | 322 |
| |
323 | 323 |
| |
324 | 324 |
| |
325 |
| - | |
| 325 | + | |
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
|
0 commit comments
Comments
(0)