diff --git a/llvm/include/llvm/Analysis/LoopInfoImpl.h b/llvm/include/llvm/Analysis/LoopInfoImpl.h --- a/llvm/include/llvm/Analysis/LoopInfoImpl.h +++ b/llvm/include/llvm/Analysis/LoopInfoImpl.h @@ -673,7 +673,8 @@ "Mismatched basic blocks in the loops!"); const SmallPtrSetImpl &BlocksSet = L->getBlocksSet(); - const SmallPtrSetImpl &OtherBlocksSet = L->getBlocksSet(); + const SmallPtrSetImpl &OtherBlocksSet = + OtherL->getBlocksSet(); assert(BlocksSet.size() == OtherBlocksSet.size() && llvm::all_of(BlocksSet, [&OtherBlocksSet](const BlockT *BB) {