summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/LeaksContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/LeaksContext.h')
-rw-r--r--lib/VMCore/LeaksContext.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/LeaksContext.h b/lib/VMCore/LeaksContext.h
index bd10a47..abff090 100644
--- a/lib/VMCore/LeaksContext.h
+++ b/lib/VMCore/LeaksContext.h
@@ -46,8 +46,9 @@ struct LeakDetectorImpl {
// immediately, it is added to the CachedValue Value. If it is
// immediately removed, no set search need be performed.
void addGarbage(const T* o) {
+ assert(Ts.count(o) == 0 && "Object already in set!");
if (Cache) {
- assert(Ts.count(Cache) == 0 && "Object already in set!");
+ assert(Cache != o && "Object already in set!");
Ts.insert(Cache);
}
Cache = o;
OpenPOWER on IntegriCloud