diff options
author | Michael Forney <mforney@mforney.org> | 2022-05-19 11:49:06 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2022-05-19 11:49:06 -0700 |
commit | 13eb0640cc58bee1a29c82c1b230137e7ff411c3 (patch) | |
tree | 4dcf9bde63a4a8c49236dc8cc3413bd753563ef4 /runtests | |
parent | b82a2315827553f8d1e7476b1261c5f1d00a7c7e (diff) |
eval: Fix range check of double during conversion to int
2⁶⁴-1 and 2⁶³-1 are not representable as double and get rounded to
2⁶⁴ and 2⁶³ respectively, which are outside the range of 64-bit
[u]int.
This causes undefined behavior when a constant expression is evaluated
that involves a conversion of a very large or small value to an
integer type.
To fix this, change the > to >= and use constants representable as
double.
Diffstat (limited to 'runtests')
0 files changed, 0 insertions, 0 deletions