summaryrefslogtreecommitdiff
path: root/lib/System/Unix
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-30 23:56:49 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-30 23:56:49 +0000
commita7e3b564773cc45a1b08383c09fe86b17b3ffe92 (patch)
tree7c8166437a73785ce2881e722b369bcd7624b83a /lib/System/Unix
parentb3c04ec956247a984b3113a01cfbfad91e5ca5b3 (diff)
downloadllvm-a7e3b564773cc45a1b08383c09fe86b17b3ffe92.tar.gz
llvm-a7e3b564773cc45a1b08383c09fe86b17b3ffe92.tar.bz2
llvm-a7e3b564773cc45a1b08383c09fe86b17b3ffe92.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix')
-rw-r--r--lib/System/Unix/Program.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index 0209f5aaf8..bbb029c4f3 100644
--- a/lib/System/Unix/Program.inc
+++ b/lib/System/Unix/Program.inc
@@ -212,7 +212,9 @@ Program::Execute(const Path &path, const char **args, const char **envp,
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));