From f4f1b266fd83c819ea2cf7cbd9bcd377d95c4eb6 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 16 Sep 2009 11:43:12 +0000 Subject: [PATCH] Don't sort the vector when it is empty. This should fix some expensive checking failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82040 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineModuleInfoImpls.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/MachineModuleInfoImpls.cpp b/lib/CodeGen/MachineModuleInfoImpls.cpp index 10de1deec4e..7a6292910f4 100644 --- a/lib/CodeGen/MachineModuleInfoImpls.cpp +++ b/lib/CodeGen/MachineModuleInfoImpls.cpp @@ -38,7 +38,8 @@ MachineModuleInfoMachO::SymbolListTy MachineModuleInfoMachO::GetSortedStubs(const DenseMap &Map) { MachineModuleInfoMachO::SymbolListTy List(Map.begin(), Map.end()); - qsort(&List[0], List.size(), sizeof(List[0]), SortSymbolPair); + if (!List.empty()) + qsort(&List[0], List.size(), sizeof(List[0]), SortSymbolPair); return List; } -- 2.34.1