Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Merge fix for use-after-free in clang 3.9. Close #637. Close #630.
Browse files Browse the repository at this point in the history
Unregister ourselves as a DiagnosticsConsumer before we are destroyed.
  • Loading branch information
erikrose committed Feb 9, 2017
2 parents debc4e4 + 68f1182 commit 6036f54
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dxr/plugins/clang/dxr-index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ class IndexConsumer : public ASTConsumer,
printPolicy.SuppressTagKeyword = true;
}

~IndexConsumer() {
#if CLANG_AT_LEAST(3, 6)
ci.getDiagnostics().setClient(inner.release());
#else
ci.getDiagnostics().setClient(inner);
#endif
}

#if CLANG_AT_LEAST(3, 3)
// `clone` was removed from the DiagnosticConsumer interface in version 3.3,
// so this can all be deleted once we're no longer supporting 3.2.
Expand Down

0 comments on commit 6036f54

Please sign in to comment.