mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 14:40:32 +00:00
fix UBSAN
This commit is contained in:
1 parent
8f5b5c7469
commit
e175150f5b
2 files changed
+4
-2
No files matched your search
@@ -12143,7 +12143,8 @@ class binary_writer
|
||||
}
|
||||
else
|
||||
{
|
||||
if (static_cast<double>(static_cast<float>(j.m_value.number_float)) == j.m_value.number_float)
|
||||
if (j.m_value.number_float < std::numeric_limits<float>::max() and
|
||||
static_cast<double>(static_cast<float>(j.m_value.number_float)) == j.m_value.number_float)
|
||||
{
|
||||
oa->write_character(get_cbor_float_prefix(static_cast<float>(j.m_value.number_float)));
|
||||
write_number(static_cast<float>(j.m_value.number_float));
|
||||
|
||||
Reference in new issue
Block a user