<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yeah,<div><br></div><div>it would, I already changed it back and added if(Weight.empty()) condition in getSuccWeight.</div><div><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>-Kuba</div></span>
</div>
<br><div><div>On Jun 17, 2011, at 3:32 PM, Jakob Stoklund Olesen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Jun 17, 2011, at 10:30 AM, Jakub Staszak wrote:<br><br><blockquote type="cite">Author: kuba<br></blockquote><blockquote type="cite">Date: Fri Jun 17 12:30:10 2011<br></blockquote><blockquote type="cite">New Revision: 133265<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=133265&view=rev">http://llvm.org/viewvc/llvm-project?rev=133265&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Allow empty Weights vector.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite">   llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=133265&r1=133264&r2=133265&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=133265&r1=133264&r2=133265&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)<br></blockquote><blockquote type="cite">+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Fri Jun 17 12:30:10 2011<br></blockquote><blockquote type="cite">@@ -776,7 +776,8 @@<br></blockquote><blockquote type="cite">/// iterator<br></blockquote><blockquote type="cite">MachineBasicBlock::weight_iterator MachineBasicBlock::<br></blockquote><blockquote type="cite">getWeightIterator(MachineBasicBlock::succ_iterator I) {<br></blockquote><blockquote type="cite">-  assert(Weights.size() == Successors.size() && "Async weight list!");<br></blockquote><blockquote type="cite">+  assert((Weights.size() == Successors.size() || Weights.empty()) &&<br></blockquote><blockquote type="cite">+         "Async weight list!");<br></blockquote><blockquote type="cite">  size_t index = std::distance(Successors.begin(), I);<br></blockquote><blockquote type="cite">  assert(index < Weights.size() && "Not a current successor!");<br></blockquote><blockquote type="cite">  return Weights.begin() + index;<br></blockquote><br>Won't the next assert fire anyway if the vector is empty? And rightly so.<br><br>/jakob<br><br></div></blockquote></div><br></div></body></html>