Re: Avoid overflow with simplehash
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Ranier Vilela <ranier.vf@gmail.com>, Daniel Gustafsson <daniel@yesql.se>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-07-06T15:46:48Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > On 2023-07-06 11:16:26 -0400, Tom Lane wrote: >> It does seem like we could do >> uint64 startelem = SH_MAX_SIZE; >> ... >> Assert(startelem < SH_MAX_SIZE); >> which'd make it a little clearer that the expectation is for >> startelem to have changed value. > I guess? I find it easier to understand all-bits-set in a coredump as > too-large than SH_MAX_SIZE, but ... What'd help even more is a comment: /* We should have found an empty element */ Assert(startelem < SH_MAX_SIZE); regards, tom lane
Commits
-
Fix type of iterator variable in SH_START_ITERATE
- 9f236198c31d 12.16 landed
- 6143602ebaab 11.21 landed
- 1508b57d4b7a 14.9 landed
- 09391ddc9578 13.12 landed
- d12d1a9278df 15.4 landed
- 727d96511ef5 16.0 landed
- f0a94d81e4f7 17.0 landed