On Apr 26, 2013, at 5:34 PM, Sean Silva <[email protected]> wrote: > - 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. >
I believe you are correct, Sean. How does revision 180658 look? > -- Sean Silva
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
