From f9a7d4274f0fd76c760348b961ad78332af2d255 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Fri, 21 Aug 2009 15:14:37 -0500 Subject: [PATCH] Fix silly crash in HashMap::remove(). r=graydon on IRC, no bug. --HG-- extra : rebase_source : 25d53309e30bec26f7a93148c9000e1c79431986 --- js/src/nanojit/Containers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/nanojit/Containers.h b/js/src/nanojit/Containers.h index 65b0a5a9921..65615f47f11 100644 --- a/js/src/nanojit/Containers.h +++ b/js/src/nanojit/Containers.h @@ -316,7 +316,7 @@ namespace nanojit /** remove k from the map, if it is present. if not, remove() * silently returns */ void remove(const K& k) { - size_t i = H::hash(k); + size_t i = H::hash(k) % nbuckets; Seq** prev = &buckets[i]; for (Seq* p = buckets[i]; p != NULL; p = p->tail) { if (p->head.key == k) {