-  char cwd[MAXPATHLEN];
-  if (pwd && ::getcwd(cwd, MAXPATHLEN)) {
+  const char *cwd = llvm::sys::Path::GetCurrentDirectory().c_str();
+  if (pwd && cwd) {

I don't think this is safe. GetCurrentDirectory returns a Path by value
(which lives until the end of the statement), and the c_str() points into
that Path.

-- Sean Silva
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to