r180658 - Fix the dangling pointer.

Chad Rosier mcrosier at apple.com
Fri Apr 26 18:19:41 PDT 2013


On Apr 26, 2013, at 6:16 PM, Jordan Rose <jordan_rose at apple.com> wrote:

> Actually, this should probably get off PathV1.h altogether, and just use llvm::sys::fs::current_path in FileSystem.h.
> 
> Sorry for asking you to change this again…

No worries, thanks for the suggestion.  I put in a temporary fix to appease the bots and gdb tests.  I'll give your suggestion a try once I am able to continue watching the bots.  For now I need to get out of the office.

Thanks, Jordan.

> 
> On Apr 26, 2013, at 17:57 , Chad Rosier <mcrosier at apple.com> wrote:
> 
>> Author: mcrosier
>> Date: Fri Apr 26 19:57:18 2013
>> New Revision: 180658
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=180658&view=rev
>> Log:
>> Fix the dangling pointer.
>> 
>> Modified:
>>    cfe/trunk/lib/Driver/Tools.cpp
>> 
>> Modified: cfe/trunk/lib/Driver/Tools.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=180658&r1=180657&r2=180658&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> +++ cfe/trunk/lib/Driver/Tools.cpp Fri Apr 26 19:57:18 2013
>> @@ -1792,8 +1792,8 @@ static void addDebugCompDirArg(const Arg
>>     return;
>>   }
>>   // Fall back to using getcwd.
>> -  const char *cwd = llvm::sys::Path::GetCurrentDirectory().c_str();
>> -  if (pwd && cwd) {
>> +  std::string cwd = llvm::sys::Path::GetCurrentDirectory().str();
>> +  if (pwd && !cwd.empty()) {
>>     CmdArgs.push_back("-fdebug-compilation-dir");
>>     CmdArgs.push_back(Args.MakeArgString(cwd));
>>   }
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130426/b7fa99db/attachment.html>


More information about the cfe-commits mailing list