diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |