mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-27 10:20:14 +00:00
2937538210
When the parser saw more significant hex digits than fit in the target type, it would compute a nonsensical shift amount, resulting in undefined behaviour. Now, drop the excess bits, effectively truncating the significand. Also guard against overflow of the exponent in the extraordinary (and untested) case where we see more than, for example, 2**(32-4+1) significant hex digits for a 32-bit float, or 2**(16-4+1) significant hex digits for a 16-bit float. Also guard against overflow of the indexing counting the number of significant bits. When that would occur silently drop any further significant bits. (Untested) Avoid hex floats in C++ code. It's a C++17 feature. Fixes: #4724 |
||
---|---|---|
.. | ||
bit_vector.cpp | ||
bit_vector.h | ||
bitutils.h | ||
hash_combine.h | ||
hex_float.h | ||
ilist_node.h | ||
ilist.h | ||
make_unique.h | ||
parse_number.cpp | ||
parse_number.h | ||
small_vector.h | ||
string_utils.cpp | ||
string_utils.h | ||
timer.cpp | ||
timer.h |