<div dir="ltr">Yes if they are pointing to .drectve section they could become invalid references.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 9:57 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How are these temporary strings ? They all are pointing to the arguments argv[].<br>
<br>
Is this to handle the .directive file ?<br>
<br>
Thanks<br>
<br>
Shankar Easwaran<div class="HOEnZb"><div class="h5"><br>
<br>
On 8/26/2013 11:27 PM, Rui Ueyama wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: ruiu<br>
Date: Mon Aug 26 23:27:18 2013<br>
New Revision: 189310<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=189310&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=189310&view=rev</a><br>
Log:<br>
Fix use of temporary strings.<br>
<br>
Modified:<br>
     lld/trunk/lib/Driver/<u></u>WinLinkDriver.cpp<br>
<br>
Modified: lld/trunk/lib/Driver/<u></u>WinLinkDriver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=189310&r1=189309&r2=189310&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/Driver/<u></u>WinLinkDriver.cpp?rev=189310&<u></u>r1=189309&r2=189310&view=diff</a><br>


==============================<u></u>==============================<u></u>==================<br>
--- lld/trunk/lib/Driver/<u></u>WinLinkDriver.cpp (original)<br>
+++ lld/trunk/lib/Driver/<u></u>WinLinkDriver.cpp Mon Aug 26 23:27:18 2013<br>
@@ -350,12 +350,12 @@ bool WinLinkDriver::parse(int argc, cons<br>
        case OPT_entry:<br>
        // handle /entry<br>
-      ctx.setEntrySymbolName(<u></u>inputArg->getValue());<br>
+      ctx.setEntrySymbolName(ctx.<u></u>allocateString(inputArg-><u></u>getValue()));<br>
        break;<br>
        case OPT_libpath:<br>
        // handle /libpath<br>
-      ctx.appendInputSearchPath(<u></u>inputArg->getValue());<br>
+      ctx.appendInputSearchPath(ctx.<u></u>allocateString(inputArg-><u></u>getValue()));<br>
        break;<br>
        case OPT_force:<br>
@@ -408,12 +408,12 @@ bool WinLinkDriver::parse(int argc, cons<br>
        case OPT_incl:<br>
        // handle /incl<br>
-      ctx.addInitialUndefinedSymbol(<u></u>inputArg->getValue());<br>
+      ctx.addInitialUndefinedSymbol(<u></u>ctx.allocateString(inputArg-><u></u>getValue()));<br>
        break;<br>
        case OPT_out:<br>
        // handle /out<br>
-      ctx.setOutputPath(inputArg-><u></u>getValue());<br>
+      ctx.setOutputPath(ctx.<u></u>allocateString(inputArg-><u></u>getValue()));<br>
        break;<br>
        case OPT_INPUT: {<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
<br>
</blockquote>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</font></span></blockquote></div><br></div>