Commit 20a97a7
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 9e430f8 commit 20a97a7
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 | |
|---|---|---|---|
| |||
1553 | 1553 | | |
1554 | 1554 | | |
1555 | 1555 | | |
1556 | | - | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
1557 | 1573 | | |
1558 | 1574 | | |
1559 | 1575 | | |
| |||
0 commit comments