Commit 055eeed
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 905e6e8 commit 055eeed
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 | |
|---|---|---|---|
| |||
1759 | 1759 | | |
1760 | 1760 | | |
1761 | 1761 | | |
1762 | | - | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1763 | 1779 | | |
1764 | 1780 | | |
1765 | 1781 | | |
| |||
0 commit comments