diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-21 04:38:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-21 04:38:40 +0000 |
commit | 3e0e41c9bba167437072c47a140d51509ebeb73c (patch) | |
tree | 97a9e7f6bdab5bb0b76d511abe298843db2bccb5 /lib/Checker/BugReporter.cpp | |
parent | e1fa09661a7949a4c55c331ea2c50e9bb35fb634 (diff) |
Delete the new visitor if an old one already exists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/BugReporter.cpp')
-rw-r--r-- | lib/Checker/BugReporter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Checker/BugReporter.cpp b/lib/Checker/BugReporter.cpp index d4b150294e..7272b34858 100644 --- a/lib/Checker/BugReporter.cpp +++ b/lib/Checker/BugReporter.cpp @@ -44,8 +44,10 @@ void BugReporterContext::addVisitor(BugReporterVisitor* visitor) { visitor->Profile(ID); void *InsertPos; - if (CallbacksSet.FindNodeOrInsertPos(ID, InsertPos)) + if (CallbacksSet.FindNodeOrInsertPos(ID, InsertPos)) { + delete visitor; return; + } CallbacksSet.InsertNode(visitor, InsertPos); Callbacks = F.Add(visitor, Callbacks); |