summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog9
-rw-r--r--hash.c2
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6307ecbd..b20f8c2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2015-06-07 Kaz Kylheku <kaz@kylheku.com>
+ 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.
+
+2015-06-07 Kaz Kylheku <kaz@kylheku.com>
+
* lib.h (mkloc): Rename misleading argument from fun to obj.
2015-06-07 Kaz Kylheku <kaz@kylheku.com>
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;
}
}