diff --git a/libguile/hash.c b/libguile/hash.c index ab47008f0..d47c7e054 100644 --- a/libguile/hash.c +++ b/libguile/hash.c @@ -286,8 +286,9 @@ scm_raw_ihash (SCM obj, size_t depth) size_t len = SCM_SIMPLE_VECTOR_LENGTH (obj); size_t i = depth / 2; unsigned long h = scm_raw_ihashq (SCM_CELL_WORD_0 (obj)); - while (i--) - h ^= scm_raw_ihash (scm_c_vector_ref (obj, h % len), i); + if (len) + while (i--) + h ^= scm_raw_ihash (scm_c_vector_ref (obj, h % len), i); return h; } case scm_tcs_cons_imcar: