mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +02:00
checking for NULL values in hash_one
This commit is contained in:
parent
68a95bc366
commit
fd2bab331a
1 changed files with 28 additions and 26 deletions
|
@ -53,6 +53,7 @@ static sexp_uint_t hash_one (sexp ctx, sexp obj, sexp_uint_t bound, sexp_sint_t
|
||||||
sexp t, *p;
|
sexp t, *p;
|
||||||
char *p0;
|
char *p0;
|
||||||
loop:
|
loop:
|
||||||
|
if (obj) {
|
||||||
#if SEXP_USE_FLONUMS
|
#if SEXP_USE_FLONUMS
|
||||||
if (sexp_flonump(obj))
|
if (sexp_flonump(obj))
|
||||||
acc ^= (sexp_sint_t) sexp_flonum_value(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 {
|
} else {
|
||||||
acc ^= (sexp_uint_t)obj;
|
acc ^= (sexp_uint_t)obj;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return (bound ? acc % bound : acc);
|
return (bound ? acc % bound : acc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue