[PATCH] D156904: [NFC][clang] Fix static analyzer concerns
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. IdDeclInfoMap 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/D156904 Files: clang/lib/Sema/IdentifierResolver.cpp Index: clang/lib/Sema/IdentifierResolver.cpp === --- clang/lib/Sema/IdentifierResolver.cpp +++ clang/lib/Sema/IdentifierResolver.cpp @@ -60,6 +60,9 @@ } } + IdDeclInfoMap(const IdDeclInfoMap &) = delete; + IdDeclInfoMap &operator=(const IdDeclInfoMap &) = delete; + /// Returns the IdDeclInfo associated to the DeclarationName. /// It creates a new IdDeclInfo if one was not created before for this id. IdDeclInfo &operator[](DeclarationName Name); Index: clang/lib/Sema/IdentifierResolver.cpp === --- clang/lib/Sema/IdentifierResolver.cpp +++ clang/lib/Sema/IdentifierResolver.cpp @@ -60,6 +60,9 @@ } } + IdDeclInfoMap(const IdDeclInfoMap &) = delete; + IdDeclInfoMap &operator=(const IdDeclInfoMap &) = delete; + /// Returns the IdDeclInfo associated to the DeclarationName. /// It creates a new IdDeclInfo if one was not created before for this id. IdDeclInfo &operator[](DeclarationName Name); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D156904: [NFC][clang] Fix static analyzer concerns
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156904/new/ https://reviews.llvm.org/D156904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D156904: [NFC][clang] Fix static analyzer concerns
This revision was automatically updated to reflect the committed changes. Closed by commit rG962deded6c30: [NFC][clang] Fix static analyzer concerns (authored by Fznamznon). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156904/new/ https://reviews.llvm.org/D156904 Files: clang/lib/Sema/IdentifierResolver.cpp Index: clang/lib/Sema/IdentifierResolver.cpp === --- clang/lib/Sema/IdentifierResolver.cpp +++ clang/lib/Sema/IdentifierResolver.cpp @@ -60,6 +60,9 @@ } } + IdDeclInfoMap(const IdDeclInfoMap &) = delete; + IdDeclInfoMap &operator=(const IdDeclInfoMap &) = delete; + /// Returns the IdDeclInfo associated to the DeclarationName. /// It creates a new IdDeclInfo if one was not created before for this id. IdDeclInfo &operator[](DeclarationName Name); Index: clang/lib/Sema/IdentifierResolver.cpp === --- clang/lib/Sema/IdentifierResolver.cpp +++ clang/lib/Sema/IdentifierResolver.cpp @@ -60,6 +60,9 @@ } } + IdDeclInfoMap(const IdDeclInfoMap &) = delete; + IdDeclInfoMap &operator=(const IdDeclInfoMap &) = delete; + /// Returns the IdDeclInfo associated to the DeclarationName. /// It creates a new IdDeclInfo if one was not created before for this id. IdDeclInfo &operator[](DeclarationName Name); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits