Fznamznon created this revision. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware. Herald added a project: All. Fznamznon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
ToolInvocation frees resources in the destructor but doesn't have user-written copy c'tor or assignment operator, so copying it using default ones can cause double free. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D156896 Files: clang/include/clang/Tooling/Tooling.h Index: clang/include/clang/Tooling/Tooling.h =================================================================== --- clang/include/clang/Tooling/Tooling.h +++ clang/include/clang/Tooling/Tooling.h @@ -267,6 +267,9 @@ ~ToolInvocation(); + ToolInvocation(const ToolInvocation &) = delete; + ToolInvocation &operator=(const ToolInvocation &) = delete; + /// Set a \c DiagnosticConsumer to use during driver command-line parsing and /// the action invocation itself. void setDiagnosticConsumer(DiagnosticConsumer *DiagConsumer) {
Index: clang/include/clang/Tooling/Tooling.h =================================================================== --- clang/include/clang/Tooling/Tooling.h +++ clang/include/clang/Tooling/Tooling.h @@ -267,6 +267,9 @@ ~ToolInvocation(); + ToolInvocation(const ToolInvocation &) = delete; + ToolInvocation &operator=(const ToolInvocation &) = delete; + /// Set a \c DiagnosticConsumer to use during driver command-line parsing and /// the action invocation itself. void setDiagnosticConsumer(DiagnosticConsumer *DiagConsumer) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits