summaryrefslogtreecommitdiffstats
path: root/gc.c
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
commit133f25494e54eb508a0f19c3abdcfc24ccc4c1ce (patch)
tree1911de3cf26417972c8175367f0fa408e588df57 /gc.c
parent146229666d039720e5ee56d21b8e937abc23f18a (diff)
downloadtxr-133f25494e54eb508a0f19c3abdcfc24ccc4c1ce.tar.gz
txr-133f25494e54eb508a0f19c3abdcfc24ccc4c1ce.tar.bz2
txr-133f25494e54eb508a0f19c3abdcfc24ccc4c1ce.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.
Diffstat (limited to 'gc.c')
-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;