Re: [llvm-commits] Patch for bug in llvm-ld

2007-05-02 Thread jlh
Chris Lattner wrote: > Thanks, but this doesn't seem safe. If the args_temp vector is > reallocated, it will move all the std::string objects, invalidating the > pointers. Right, I wasn't thinking enough. One solution would be to use std::list instead. But anyway, I only wanted to point out the

Re: [llvm-commits] Patch for bug in llvm-ld

2007-05-01 Thread Chris Lattner
On Apr 30, 2007, at 6:45 AM, jlh wrote: > Hello! > > I've been told to send this here. In tools/llvm-ld/llvm-ld.cpp, > line 360, a const char* to a temporary std::string is being > stored, with the string going out of scope right after, making > that pointer invalid. > > std::string lib_name =

[llvm-commits] Patch for bug in llvm-ld

2007-04-30 Thread jlh
Hello! I've been told to send this here. In tools/llvm-ld/llvm-ld.cpp, line 360, a const char* to a temporary std::string is being stored, with the string going out of scope right after, making that pointer invalid. std::string lib_name = "-l" + LinkItems[index].first; args.push_back(lib