From 7b57fe3554d29c218d6c25df66ecb2c7cad21353 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 8 Apr 2007 20:06:05 +0000 Subject: [PATCH] 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 --- tools/llvm-db/Commands.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/llvm-db/Commands.cpp b/tools/llvm-db/Commands.cpp index 487d5ec5360..e0162e39567 100644 --- a/tools/llvm-db/Commands.cpp +++ b/tools/llvm-db/Commands.cpp @@ -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()) {