aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/funcs.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2024-09-23 11:37:12 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2024-09-23 11:37:12 +0200
commita7e5237f268ea378c514635d65a55aa47621958a (patch)
treec66a10640a8368438369906c21fcf3a9f7698aab /src/tutorial/funcs.c
parent40708acd65c112149493d7159ca5c5a9391c9d35 (diff)
downloadpostgresql-a7e5237f268ea378c514635d65a55aa47621958a.tar.gz
postgresql-a7e5237f268ea378c514635d65a55aa47621958a.zip
Fix asserts in fast-path locking code
Commit c4d5cb71d229 introduced a couple asserts in the fast-path locking code, upsetting Coverity. The assert in InitProcGlobal() is clearly wrong, as it assigns instead of 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 check for (val >= 0) useless. Checks written as ((uint32) x < max) work for both signed and unsigned values. Negative values should wrap to values greater than INT32_MAX. Per Coverity, report by Tom Lane. Reported-by: Tom Lane Discussion: https://postgr.es/m/2891628.1727019959@sss.pgh.pa.us
Diffstat (limited to 'src/tutorial/funcs.c')
0 files changed, 0 insertions, 0 deletions