summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-09-27 20:58:17 +0000
committerJim Ingham <jingham@apple.com>2013-09-27 20:58:17 +0000
commit6dafc4203da5a3f4c74afe17f23e7e50f8154aee (patch)
treefe5e2a1ea1c6c4012fe263e5c08a9acdaa64a0b6
parent13ca93c0e36b0f9dd2c4b76c25eb756ea03ea49e (diff)
downloadbcm5719-llvm-6dafc4203da5a3f4c74afe17f23e7e50f8154aee.tar.gz
bcm5719-llvm-6dafc4203da5a3f4c74afe17f23e7e50f8154aee.zip
If you erase while iterating, remember to update the iterator. Bug found by Carlo Kok.
llvm-svn: 191555
-rw-r--r--lldb/source/Symbol/Symtab.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 27af6988aa9..d3ea9d68e25 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -682,7 +682,7 @@ Symtab::AppendSymbolIndexesWithNameAndType (const ConstString& symbol_name, Symb
if (symbol_type == eSymbolTypeAny || m_symbols[*pos].GetType() == symbol_type)
++pos;
else
- indexes.erase(pos);
+ pos = indexes.erase(pos);
}
}
return indexes.size();
@@ -701,7 +701,7 @@ Symtab::AppendSymbolIndexesWithNameAndType (const ConstString& symbol_name, Symb
if (symbol_type == eSymbolTypeAny || m_symbols[*pos].GetType() == symbol_type)
++pos;
else
- indexes.erase(pos);
+ pos = indexes.erase(pos);
}
}
return indexes.size();
OpenPOWER on IntegriCloud