1
0
mirror of https://github.com/nlohmann/json synced 2024-11-15 08:40:05 +00:00

🚨 fix UBSAN warning

This commit is contained in:
Niels Lohmann 2020-07-23 14:06:09 +02:00
parent bba57cc4af
commit 0cd120f7e1
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69

View File

@ -515,7 +515,7 @@ TEST_CASE("MessagePack")
(static_cast<uint32_t>(result[2]) << 020) +
(static_cast<uint32_t>(result[3]) << 010) +
static_cast<uint32_t>(result[4]);
CHECK(restored == i);
CHECK(static_cast<std::int32_t>(restored) == i);
// roundtrip
CHECK(json::from_msgpack(result) == j);