Bring some MSVC asserts in line with other platforms
authorJohn Naylor <john.naylor@postgresql.org>
Mon, 31 Jul 2023 06:34:29 +0000 (13:34 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Mon, 31 Jul 2023 07:46:21 +0000 (14:46 +0700)
commit39055cb4ccd5b521ceb802b6a8194de912a422cc
tree6ba2bab47e7c822c20618e5bc1e6b9be485443bb
parent7395a90db87bcb2f617d3c486657813122d3f151
Bring some MSVC asserts in line with other platforms

MSVC's _BitScan* functions return a boolean indicating whether any
bits were set in the input, and we were previously asserting that
they returned true, per our API. This is correct. However, other
platforms simply assert that the input is non-zero, so do that to be
more consistent.

Noted while investigating a hypothesis from Ranier Vilela about
undefined behavior, but this is not his proposed patch.

Discussion: https://www.postgresql.org/message-id/CAEudQAoDhUZyKGJ1vbMGcgVUOcsixe-%3DjcVaDWarqkUg163D2w%40mail.gmail.com
src/include/port/pg_bitutils.h