From a6591969ffa7b022656db25f33788fcf57361ac5 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Fri, 17 Jun 2011 17:30:10 +0000 Subject: [PATCH] Allow empty Weights vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133265 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineBasicBlock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 613f0c4f7f5..7d7bfb1fc30 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -776,7 +776,8 @@ uint32_t MachineBasicBlock::getSuccWeight(MachineBasicBlock *succ) { /// iterator MachineBasicBlock::weight_iterator MachineBasicBlock:: getWeightIterator(MachineBasicBlock::succ_iterator I) { - assert(Weights.size() == Successors.size() && "Async weight list!"); + assert((Weights.size() == Successors.size() || Weights.empty()) && + "Async weight list!"); size_t index = std::distance(Successors.begin(), I); assert(index < Weights.size() && "Not a current successor!"); return Weights.begin() + index; -- 2.34.1