summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit31158b583aba82829dbbcac843fa839719055433 (patch)
tree1a39a626d0fd2f11126e98a049246d3b57795d63 /llvm/lib/System/Unix
parentb9b63ee03186ab0f815e8ee27300ac3ddba43bf1 (diff)
downloadbcm5719-llvm-31158b583aba82829dbbcac843fa839719055433.tar.gz
bcm5719-llvm-31158b583aba82829dbbcac843fa839719055433.zip
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
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Program.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc
index 0209f5aaf83..bbb029c4f3e 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<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));
OpenPOWER on IntegriCloud