The attached patch, not yet for application, uses the Valgrind memcheck header 
to mark items on the stack as initialized.  This clears up most of the 
uninitialized read errors in our Valgrind checks, which makes it easier to 
find real errors.

I'm not applying this patch yet because we need a conditional include of the 
Memcheck header, probably probed from configure, and an empty declaration of 
this macro if it's not available.  It's fine with me if the configuration 
only runs during debugging mode or something similar.

-- c

=== src/gc/dod.c
==================================================================
--- src/gc/dod.c	(revision 27223)
+++ src/gc/dod.c	(local)
@@ -27,6 +27,7 @@
 #define DOD_C_SOURCE
 #include "parrot/parrot.h"
 #include "parrot/dod.h"
+#include <valgrind/memcheck.h>
 
 /* HEADERIZER HFILE: include/parrot/dod.h */
 
@@ -873,6 +874,8 @@
         lo_var_ptr           = tmp_ptr;
     }
 
+    VALGRIND_MAKE_MEM_DEFINED(&lo_var_ptr, lo_var_ptr - hi_var_ptr);
+
     /* Get the expected prefix */
     prefix = mask & buffer_min;
 

Reply via email to