From 31158b583aba82829dbbcac843fa839719055433 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 30 Sep 2010 23:56:49 +0000 Subject: [PATCH] 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. llvm-svn: 115242 --- llvm/lib/System/Unix/Program.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index 0209f5aaf832..bbb029c4f3ec 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -212,7 +212,9 @@ Program::Execute(const Path &path, const char **args, const char **envp, envp = const_cast(*_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(args), const_cast(envp));