summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 364c5180..8a4c554b 100644
--- a/hash.c
+++ b/hash.c
@@ -666,10 +666,9 @@ static struct cobj_ops hash_iter_ops = {
val hash_begin(val hash)
{
val hi_obj;
- struct hash_iter *hi;
- struct hash *h = (struct hash *) hash->co.handle;
+ struct hash *h = coerce(struct hash *, cobj_handle(hash, hash_s));
+ struct hash_iter *hi = coerce(struct hash_iter *, chk_malloc(sizeof *hi));
- hi = coerce(struct hash_iter *, chk_malloc(sizeof *hi));
hi->next = 0;
hi->hash = nil;
hi->chain = -1;