<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 10, 2015, at 9:46 AM, David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Aug 10, 2015 at 9:15 AM, Yaron Keren via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: yrnkrn<br class="">
Date: Mon Aug 10 11:15:51 2015<br class="">
New Revision: 244455<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=244455&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=244455&view=rev</a><br class="">
Log:<br class="">
Modify r244405 to clearer code, per David Blaikie suggestion.<br class="">
<br class="">
<br class="">
Modified:<br class="">
    llvm/trunk/tools/dsymutil/DwarfLinker.cpp<br class="">
<br class="">
Modified: llvm/trunk/tools/dsymutil/DwarfLinker.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DwarfLinker.cpp?rev=244455&r1=244454&r2=244455&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DwarfLinker.cpp?rev=244455&r1=244454&r2=244455&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/tools/dsymutil/DwarfLinker.cpp (original)<br class="">
+++ llvm/trunk/tools/dsymutil/DwarfLinker.cpp Mon Aug 10 11:15:51 2015<br class="">
@@ -2884,8 +2884,8 @@ void DwarfLinker::patchLineTableForUnit(<br class="">
       if (StopAddress != -1ULL && !Seq.empty()) {<br class="">
         // Insert end sequence row with the computed end address, but<br class="">
         // the same line as the previous one.<br class="">
-        Seq.reserve(Seq.size() + 1);<br class="">
-        Seq.emplace_back(Seq.back());<br class="">
+        auto NextLine = Seq.back();<br class="">
+        Seq.emplace_back(NextLine);<br class=""></blockquote><div class=""><br class="">I don't think there's any benefit to emplace_back here since there are no explicit conversions required. I'd probably usse push_back - and this still seems like it'd be easy for someone to just decide to fold the two statements together & create the original bug. The suggestion I was making was to avoid doing the initialization (the following several assignment statements \/ ) on the container element itself, but do it on the local. Then push that local onto the sequence - that seems less subtle (or at least it hides it better by not making it look like a trivial cleanup to collapse two expressions would be an improvement).<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>FWIW, I agree with David here.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
         Seq.back().Address = StopAddress;<br class="">
         Seq.back().EndSequence = 1;<br class="">
         Seq.back().PrologueEnd = 0;<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div><br class=""></div></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>