From 5aa295182d3fa1ffc60139d6e877d61563b28397 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 7 Nov 2010 23:48:58 +0100 Subject: [PATCH] sxhash coerces long-float to long-double, causing underflows/overflows --- src/c/hash.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c/hash.d b/src/c/hash.d index 57d12c3c3..2b8056df6 100644 --- a/src/c/hash.d +++ b/src/c/hash.d @@ -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)); }