mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-16 06:12:25 -08:00
sxhash coerces long-float to long-double, causing underflows/overflows
This commit is contained in:
parent
1f9bf63cae
commit
5aa295182d
1 changed files with 2 additions and 2 deletions
|
|
@ -59,7 +59,7 @@ _hash_eql(cl_hashkey h, cl_object x)
|
|||
/* We coerce to double because long double has extra bits
|
||||
* that give rise to different hash key and are not
|
||||
* meaningful */
|
||||
double d = ecl_long_float(x);
|
||||
long double d = ecl_long_float(x);
|
||||
return hash_string(h, (unsigned char*)&d, sizeof(d));
|
||||
}
|
||||
#endif
|
||||
|
|
@ -136,7 +136,7 @@ _hash_equal(int depth, cl_hashkey h, cl_object x)
|
|||
/* We coerce to double because long double has extra bits
|
||||
* that give rise to different hash key and are not
|
||||
* meaningful */
|
||||
double f = ecl_long_float(x);
|
||||
long double f = ecl_long_float(x);
|
||||
if (f == 0.0) f = 0.0;
|
||||
return hash_string(h, (unsigned char*)&f, sizeof(f));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue