[llvm-commits] [llvm] r115242 - /llvm/trunk/lib/System/Unix/Program.inc

Daniel Dunbar daniel at zuster.org
Thu Sep 30 16:56:49 PDT 2010


Author: ddunbar
Date: Thu Sep 30 18:56:49 2010
New Revision: 115242

URL: http://llvm.org/viewvc/llvm-project?rev=115242&view=rev
Log:
Add an explicit initialization to work around what appears to be a valgrind
false positive, at least on Darwin. I haven't filed this, but you can feel free.

Modified:
    llvm/trunk/lib/System/Unix/Program.inc

Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=115242&r1=115241&r2=115242&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Thu Sep 30 18:56:49 2010
@@ -212,7 +212,9 @@
       envp = const_cast<const char **>(*_NSGetEnviron());
 #endif
 
-    pid_t PID;
+    // Explicitly initialized to prevent what appears to be a valgrind false
+    // positive.
+    pid_t PID = 0;
     int Err = posix_spawn(&PID, path.c_str(), &FileActions, /*attrp*/0,
                           const_cast<char **>(args), const_cast<char **>(envp));
                           





More information about the llvm-commits mailing list