KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.9k stars 816 forks source link

Check for exponent overflow in float parser #3562

Closed arcady-lunarg closed 3 months ago

arcady-lunarg commented 3 months ago

Even for a double precision float, the largest valid exponent is 308, so clamp exponents to 500 when parsing to avoid overflow of the parsed exponent value if the exponent is too big.

Also add a test for this case courtesy of @jimihem.