summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-06-07 21:37:36 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-06-07 21:37:36 -0700
commitb50fa12ce36728c4bcc5a5ee7b0717ccedaef87b (patch)
tree703a609ec7e451a786333a593162cb5df00c5e14 /hash.c
parente131c739eaa55df3b6515fc91e150b12ee77152b (diff)
downloadtxr-b50fa12ce36728c4bcc5a5ee7b0717ccedaef87b.tar.gz
txr-b50fa12ce36728c4bcc5a5ee7b0717ccedaef87b.tar.bz2
txr-b50fa12ce36728c4bcc5a5ee7b0717ccedaef87b.zip
Critical bugfix for weak hashes.
* hash.c (hash_mark): Hash tables which have both weak keys and values were not added to the reachable_weak_hashes list, and thus not subject to complete hash processing, leading to corruption.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index f5130e73..1368376a 100644
--- a/hash.c
+++ b/hash.c
@@ -422,6 +422,8 @@ static void hash_mark(val hash)
break;
case hash_weak_both:
/* Values and keys are weak: don't mark anything. */
+ h->next = reachable_weak_hashes;
+ reachable_weak_hashes = h;
break;
}
}