From 133f25494e54eb508a0f19c3abdcfc24ccc4c1ce Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 13 May 2017 07:34:35 -0700 Subject: 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. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3