summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 7ee39d43..86b7a2f5 100644
--- a/hash.c
+++ b/hash.c
@@ -359,11 +359,14 @@ static struct cobj_ops hash_iter_ops = {
val hash_begin(val hash)
{
+ val hi_obj;
struct hash_iter *hi = (struct hash_iter *) chk_malloc(sizeof *hi);
- hi->hash = hash;
+ hi->hash = nil;
hi->chain = -1;
hi->cons = nil;
- return cobj((mem_t *) hi, hash_iter_s, &hash_iter_ops);
+ hi_obj = cobj((mem_t *) hi, hash_iter_s, &hash_iter_ops);
+ hi->hash = hash;
+ return hi_obj;
}
val hash_next(val *iter)