From a5b863c29bb27b77200b7c683ecdf56f4426fade Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Thu, 2 Apr 2015 04:58:12 +0000 Subject: [PATCH] [ADT] Increment epoch from DenseMap::swap. Swapping DenseMap A with DenseMap B invalidates iterators pointing into both A and B. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233890 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/DenseMap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 443a620d1af..7bfa8b22f7a 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -584,6 +584,8 @@ public: } void swap(DenseMap& RHS) { + this->incrementEpoch(); + RHS.incrementEpoch(); std::swap(Buckets, RHS.Buckets); std::swap(NumEntries, RHS.NumEntries); std::swap(NumTombstones, RHS.NumTombstones); -- 2.40.0