Avoid temporary construction and potential for corrupted data access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35771 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-04-08 20:06:05 +00:00
parent 84c8a9c592
commit 7b57fe3554

View File

@ -49,10 +49,9 @@ void CLIDebugger::startProgramRunning() {
eliminateRunInfo();
// If the program has been modified, reload it!
sys::Path Program(Dbg.getProgramPath());
sys::PathWithStatus Program(Dbg.getProgramPath());
std::string Err;
const sys::FileStatus *Status =
sys::PathWithStatus(Program).getFileStatus(false, &Err);
const sys::FileStatus *Status = Program.getFileStatus(false, &Err);
if (!Status)
throw Err;
if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) {