checking for NULL values in hash_one

This commit is contained in:
Alex Shinn 2011-11-04 16:00:27 +09:00
parent 68a95bc366
commit fd2bab331a

View file

@ -53,6 +53,7 @@ static sexp_uint_t hash_one (sexp ctx, sexp obj, sexp_uint_t bound, sexp_sint_t
sexp t, *p;
char *p0;
loop:
if (obj) {
#if SEXP_USE_FLONUMS
if (sexp_flonump(obj))
acc ^= (sexp_sint_t) sexp_flonum_value(obj);
@ -86,6 +87,7 @@ static sexp_uint_t hash_one (sexp ctx, sexp obj, sexp_uint_t bound, sexp_sint_t
} else {
acc ^= (sexp_uint_t)obj;
}
}
return (bound ? acc % bound : acc);
}