From 86145611b0ad8c6ef6923f65f8a4fd39f07f69d7 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 23 Mar 2009 18:32:37 -0700 Subject: allow range on nil maps R=ken OCL=26663 CL=26663 --- src/runtime/hashmap.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/runtime/hashmap.c') diff --git a/src/runtime/hashmap.c b/src/runtime/hashmap.c index bb8dd7ba98..b3022ca149 100644 --- a/src/runtime/hashmap.c +++ b/src/runtime/hashmap.c @@ -870,6 +870,10 @@ sys·mapassign2(Hmap *h, ...) void sys·mapiterinit(Hmap *h, struct hash_iter *it) { + if(h == nil) { + it->data = nil; + return; + } hash_iter_init(h, it); it->data = hash_next(it); if(debug) { -- cgit v1.3-5-g9baa