aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-11 20:38:25 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-11 20:38:25 +0000
commit70e2d38361b675ed8c3d874d091636c470795550 (patch)
tree43d0afade09ea075783cc686fcf1520b2b65c1d7
parent66e7cd0eea6f116f3ed79acb8948c6d8db50833c (diff)
downloadexternal_llvm-70e2d38361b675ed8c3d874d091636c470795550.zip
external_llvm-70e2d38361b675ed8c3d874d091636c470795550.tar.gz
external_llvm-70e2d38361b675ed8c3d874d091636c470795550.tar.bz2
Fix the replace method to assert if an item was erased from the set but not
found in the vector. Previously, it just ignored this condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16296 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/SetVector.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/SetVector.h b/include/llvm/ADT/SetVector.h
index 8d7382e..cd5c2df 100644
--- a/include/llvm/ADT/SetVector.h
+++ b/include/llvm/ADT/SetVector.h
@@ -113,8 +113,8 @@ public:
void remove(const value_type& X) {
if (0 < set_.erase(X)) {
iterator I = find(vector_.begin(),vector_.end(),X);
- if (I != vector_.end())
- vector_.erase(I);
+ assert(I != vector_.end() && "Corrupted SetVector instances!");
+ vector_.erase(I);
}
}