Workaround issue in MSVC arm64 compiler returning random upper 32-bits in function spvtools::util::CountSetBits. (#5763)

Fix issue #5762
This commit is contained in:
Markus Tavenrath 2024-08-07 20:11:11 +02:00 committed by GitHub
parent 72c291332a
commit b64a423b44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,7 +97,7 @@ template <typename T>
size_t CountSetBits(T word) { size_t CountSetBits(T word) {
static_assert(std::is_integral<T>::value, static_assert(std::is_integral<T>::value,
"CountSetBits requires integer type"); "CountSetBits requires integer type");
size_t count = 0; uint32_t count = 0;
while (word) { while (word) {
word &= word - 1; word &= word - 1;
++count; ++count;