--- src/google/protobuf/parse_context.h 2026-06-12 00:26:38.000000000 +0800 +++ src/google/protobuf/parse_context.h 2026-06-28 05:48:51.000000000 +0800 @@ -1581,8 +1581,13 @@ // continuation bit not set. In a valid varint there is only 1 such byte. if (end - ptr >= 16) { if constexpr (std::is_same_v && sizeof(bool) == sizeof(uint8_t)) { - if (absl::bit_cast(false) == 0 && // Not constexpr on MSVC. - absl::bit_cast(true) == 1) { + auto bool_as_byte = [](bool b) -> uint8_t { + uint8_t v; + std::memcpy(&v, &b, 1); + return v; + }; + if (bool_as_byte(false) == 0 && // Not constexpr on MSVC. + bool_as_byte(true) == 1) { if (VerifyBoolsAssumingLargeArray(ptr, end)) { // Each byte is 0 or 1. const int count = end - ptr;