Commit 2005761
committed
Review fix on #361: range-guard before the int64 cast in the hash normalizer
The value-normalizing hash cast the double to int64 in the FIRST
conjunct, before the range checks - UB for NaN, inf, and |x| >= 2^63
(UBSan float-cast-overflow abort at scalar_number.h:117, the very
class this PR removes elsewhere). NaN/inf now short-circuit via the
range comparisons (false for NaN) before any cast. Regression test
hashes 1e300/NaN/inf constants.
Signed-off-by: petlenz <peterlenz89.pl@gmail.com>1 parent 3af6dfe commit 2005761
2 files changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1401 | 1401 | | |
1402 | 1402 | | |
1403 | 1403 | | |
1404 | | - | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
1405 | 1421 | | |
1406 | 1422 | | |
1407 | 1423 | | |
| |||
0 commit comments