From 554fc892d4b78aac02935e46835403a0b4f5550d Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Fri, 21 Sep 2012 23:02:44 +0200 Subject: [PATCH] In some circumstances, gethash acting on a weak hash would return corrupt values --- src/c/hash.d | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/c/hash.d b/src/c/hash.d index 35853b3e1..51e133643 100644 --- a/src/c/hash.d +++ b/src/c/hash.d @@ -527,7 +527,6 @@ copy_entry(struct ecl_hashtable_entry *e, cl_object h) h->hash.entries--; output.key = OBJNULL; output.value = ECL_NIL; - h->hash.entries--; return *e = output; } } @@ -540,17 +539,15 @@ _ecl_weak_hash_loop(cl_hashkey h, cl_object key, cl_object hashtable, cl_index i = h % hsize, j = hsize, k; for (k = 0; k < hsize; i = (i + 1) % hsize, k++) { struct ecl_hashtable_entry *p = hashtable->hash.data + i; - struct ecl_hashtable_entry e = copy_entry(p, hashtable); + struct ecl_hashtable_entry e = *aux = copy_entry(p, hashtable); if (e.key == OBJNULL) { if (e.value == OBJNULL) { if (j == hsize) { - *aux = e; return p; } else { return hashtable->hash.data + j; } } else { - *aux = e; if (j == hsize) { j = i; } else if (j == i) {