From: Reid Spencer Date: Sat, 11 Sep 2004 20:38:25 +0000 (+0000) Subject: Fix the replace method to assert if an item was erased from the set but not X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70e2d38361b675ed8c3d874d091636c470795550;p=oota-llvm.git 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 --- diff --git a/include/llvm/ADT/SetVector.h b/include/llvm/ADT/SetVector.h index 8d7382e0563..cd5c2df7f11 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); } }