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

jlh jlh at gmx.ch
Mon Apr 30 06:45:54 PDT 2007


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_name.c_str());
    <end of scope>

The attached patch fixes this in a simple way.

jlh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1197 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070430/620cefab/attachment.bin>


More information about the llvm-commits mailing list