From 70e2d38361b675ed8c3d874d091636c470795550 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 11 Sep 2004 20:38:25 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/SetVector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } -- 2.11.0