summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-13 07:34:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-13 07:34:35 -0700
commitde8a9d9b460786a994aeb48d3fe181b9f3974fc4 (patch)
tree1911de3cf26417972c8175367f0fa408e588df57
parent0d02e4f0f9d4e5a9a9eba431d26f7d996803fa25 (diff)
downloadtxr-de8a9d9b460786a994aeb48d3fe181b9f3974fc4.tar.gz
txr-de8a9d9b460786a994aeb48d3fe181b9f3974fc4.tar.bz2
txr-de8a9d9b460786a994aeb48d3fe181b9f3974fc4.zip
gc: bug in --free-all --vg-debug combination.
* gc.c (gc_free_all): Mark defined the current block being iterated, not the next one. Otherwise Valgrind generates numerous false errors from accesses to free objects in the first block. Not to mention that next is a null pointer in the last iteration.
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index dea37403..9d5897b4 100644
--- a/gc.c
+++ b/gc.c
@@ -998,7 +998,7 @@ void gc_free_all(void)
#if HAVE_VALGRIND
if (opt_vg_debug)
- VALGRIND_MAKE_MEM_DEFINED(&next->block, sizeof next->block);
+ VALGRIND_MAKE_MEM_DEFINED(&iter->block, sizeof iter->block);
#endif
for (block = iter->block, end = iter->block + HEAP_SIZE;