SPIRV-Tools/source/util
David Neto 8dc0030ecb
spirv-as: Avoid overflow when parsing exponents on hex floats (#4874)
* spirv-as: Avoid overflow when parsing exponents on hex floats

When an exponent is so large that it would overflow the int
type in the parser, saturate the exponent.
This allows extremely large exponents, and saturates
to infinity when the exponent is positive, and zero when the exponent
is negative.

Fixes #4721.

* Avoid unexpected narrowing conversions from arithmetic operations

Co-authored-by: Alastair F. Donaldson <alastair.donaldson@imperial.ac.uk>
2022-07-28 09:40:07 -04:00
..
bit_vector.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
bit_vector.h Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
bitutils.h Support constant-folding UConvert and SConvert (#2960) 2019-10-16 16:29:55 -04:00
hash_combine.h Optimize Type::HashValue (#4707) 2022-02-15 18:57:39 +00:00
hex_float.h spirv-as: Avoid overflow when parsing exponents on hex floats (#4874) 2022-07-28 09:40:07 -04:00
ilist_node.h Rewrite include guards (#1793) 2018-08-03 08:05:33 -04:00
ilist.h Suppress -Wunused-but-set-variable on variable (#4777) 2022-04-01 17:07:05 +01:00
make_unique.h Use MakeUnique. (#1837) 2018-08-14 15:01:50 -04:00
parse_number.cpp Use MakeUnique. (#1837) 2018-08-14 15:01:50 -04:00
parse_number.h Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
small_vector.h Optimize Type::HashValue (#4707) 2022-02-15 18:57:39 +00:00
string_utils.cpp Add option for the max id bound. (#1870) 2018-09-10 11:49:41 -04:00
string_utils.h Fix endianness of string literals (#4622) 2021-12-08 12:01:26 -05:00
timer.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
timer.h Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00