<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 29, 2015 at 11:01 AM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On May 29, 2015, at 10:59 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><br><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Fri, May 29, 2015 at 10:19 AM, Pete Cooper<span> </span><span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: pete<br>Date: Fri May 29 12:19:11 2015<br>New Revision: 238579<br><br>URL:<span> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238579-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=j0jNlr4t3dU5xa8msIfZOIuvBoPjt46-g1A2qaRb3-E&s=KWDOWkp2PhIN11Xv0u8iH86Lv-e0SPY9Ef9O6mjazuc&e=" target="_blank">http://llvm.org/viewvc/llvm-project?rev=238579&view=rev</a><br>Log:<br>Fix crash in MCExpr::print.<br><br>Symbols are no longer required to be named, but this leads to a crash here if an<br>unnamed symbol checks that its first character is '$'.<br><br>Change the code to first check for a name, then check its first character.<br><br>No test case i'm afraid as this is debugging code, but any test case with temp labels<br>and 'llc --debug --filetype=obj' would have crashed.<br></blockquote><div><br>I think I missed a step - why wouldn't we have a test that does that? (llc --debug --filetype=obj)?<br></div></div></div></blockquote></span>I guess we could, I just didn’t think we tended to have tests that do --debug.  I’ve got no problem adding it if you want.</div></div></blockquote><div><br>Doesn't look like we do, but I reckon it wouldn't hurt to add them/some/a start.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Cheers,</div><div>Pete<span class=""><br><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>Modified:<br>   <span> </span>llvm/trunk/lib/MC/MCExpr.cpp<br><br>Modified: llvm/trunk/lib/MC/MCExpr.cpp<br>URL:<span> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MCExpr.cpp-3Frev-3D238579-26r1-3D238578-26r2-3D238579-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=j0jNlr4t3dU5xa8msIfZOIuvBoPjt46-g1A2qaRb3-E&s=TMpWg4yJ-0ScWXtYg2TzaxxJFfAA39TH15d6xPWvgLw&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=238579&r1=238578&r2=238579&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/MC/MCExpr.cpp (original)<br>+++ llvm/trunk/lib/MC/MCExpr.cpp Fri May 29 12:19:11 2015<br>@@ -43,7 +43,7 @@ void MCExpr::print(raw_ostream &OS) cons<br>     const MCSymbol &Sym = SRE.getSymbol();<br>     // Parenthesize names that start with $ so that they don't look like<br>     // absolute names.<br>-    bool UseParens = Sym.getName()[0] == '$';<br>+    bool UseParens = !Sym.getName().empty() && Sym.getName()[0] == '$';<br></blockquote></div></div></blockquote></span></div></div></blockquote><div><br>Also, might be easier to just write this as: Sym.getName().startswith("$")<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">     if (UseParens)<br>       OS << '(' << Sym << ')';<br>     else<br><br><br>_______________________________________________<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/mailman/listinfo/llvm-commits</a></blockquote></div></div></blockquote></span></div><br></div></blockquote></div><br></div></div>