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 | bf1dbf37e748ef986a8df982114c698c9ba9c475 (patch) | |
| tree | b1eaa9334e71c8be0219a4952772b3fce6b4ae9e /clang/lib/Checker | |
| parent | 2e4b02d6c13e76bc1d4eb4fc36577eaedef5944b (diff) | |
| download | bcm5719-llvm-bf1dbf37e748ef986a8df982114c698c9ba9c475.tar.gz bcm5719-llvm-bf1dbf37e748ef986a8df982114c698c9ba9c475.zip | |
Delete the new visitor if an old one already exists.
llvm-svn: 99114
Diffstat (limited to 'clang/lib/Checker')
| -rw-r--r-- | clang/lib/Checker/BugReporter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Checker/BugReporter.cpp b/clang/lib/Checker/BugReporter.cpp index d4b150294e6..7272b348581 100644 --- a/clang/lib/Checker/BugReporter.cpp +++ b/clang/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); |

