_hash_equalp() did not contain a case for bignums.
authorJuanjo Garcia-Ripoll <jjgarcia@users.sf.net>
Tue, 29 Oct 2013 22:47:54 +0000 (23:47 +0100)
committerJuanjo Garcia-Ripoll <jjgarcia@users.sf.net>
Tue, 29 Oct 2013 22:47:54 +0000 (23:47 +0100)
src/c/hash.d

index bb68640..88b8427 100644 (file)
@@ -193,6 +193,9 @@ _hash_equalp(int depth, cl_hashkey h, cl_object x)
                return hash_word(h, (cl_index)ecl_double_float(x));
        case t_bignum:
                /* FIXME! We should be more precise here! */
+               return hash_string(h, (unsigned char*)x->big.big_num->_mp_d,
+                                  abs(x->big.big_num->_mp_size) *
+                                  sizeof(mp_limb_t));
        case t_ratio:
                h = _hash_equalp(0, h, x->ratio.num);
                return _hash_equalp(0, h, x->ratio.den);