summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-30 13:23:39 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-11-30 13:23:39 -0800
commit42eb490febc7633ed162289921ce997ea4e35d18 (patch)
tree1be1db64f759c74b90dbc4c32b6ed2d67121ea36
parent1702ed8df842ca7c80c293e4e5f353dbf370c0fd (diff)
downloadtxr-42eb490febc7633ed162289921ce997ea4e35d18.tar.gz
txr-42eb490febc7633ed162289921ce997ea4e35d18.tar.bz2
txr-42eb490febc7633ed162289921ce997ea4e35d18.zip
* hash.c (hash_process_weak): Fix regression caused by a mistake
in the the 2010-01-26 commit, prior to release 033. When processing a table with weak values, this function was mistakenly testing the keys rather than values for for reachability. I noticed this when a test case that should run in constant memory showed unwarranted accumulation of memory.
-rw-r--r--ChangeLog9
-rw-r--r--hash.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a9afc59..e79a1d2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2011-11-30 Kaz Kylheku <kaz@kylheku.com>
+ * hash.c (hash_process_weak): Fix regression caused by a mistake
+ in the the 2010-01-26 commit, prior to release 033. When processing a
+ table with weak values, this function was mistakenly testing the keys
+ rather than values for for reachability. I noticed this when a test
+ case that should run in constant memory showed unwarranted accumulation
+ of memory.
+
+2011-11-30 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (op_modplace): Bugfix: conflation of new value and
increment value. Separate new value and increment value, and check
number of arguments.
diff --git a/hash.c b/hash.c
index 618acc75..c2dee744 100644
--- a/hash.c
+++ b/hash.c
@@ -455,7 +455,7 @@ void hash_process_weak(void)
for (iter = pchain; !gc_is_reachable(*iter); ) {
val entry = car(*iter);
- if (!gc_is_reachable(entry) && !gc_is_reachable(car(entry)))
+ if (!gc_is_reachable(entry) && !gc_is_reachable(cdr(entry)))
*iter = cdr(*iter);
else
iter = cdr_l(*iter);