summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Symbol/Symtab.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 3e2c965509d..5586b2537fd 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -616,8 +616,10 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
std::stable_sort(indexes.begin(), indexes.end(), comparator);
// Remove any duplicates if requested
- if (remove_duplicates)
- std::unique(indexes.begin(), indexes.end());
+ if (remove_duplicates) {
+ auto last = std::unique(indexes.begin(), indexes.end());
+ indexes.erase(last, indexes.end());
+ }
}
uint32_t Symtab::AppendSymbolIndexesWithName(const ConstString &symbol_name,
OpenPOWER on IntegriCloud