From 0563523eb3cdc046d98013c8f6f7b374f7bb4adb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 25 Oct 2014 17:53:40 -0700 Subject: * hash.c (hash_begin): Use coerce macro instead of raw C cast. Use cobj_handle so hash argument is validated. * parser.l (YY_INPUT): Use convert macro instead of raw C cast. --- hash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hash.c') 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; -- cgit v1.2.3