Author: Podchishchaeva, Mariya Date: 2023-08-03T01:52:26-07:00 New Revision: 962deded6c30193175b4d96d6397e29bf6c238e9
URL: https://github.com/llvm/llvm-project/commit/962deded6c30193175b4d96d6397e29bf6c238e9 DIFF: https://github.com/llvm/llvm-project/commit/962deded6c30193175b4d96d6397e29bf6c238e9.diff LOG: [NFC][clang] Fix static analyzer concerns 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. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D156904 Added: Modified: clang/lib/Sema/IdentifierResolver.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/IdentifierResolver.cpp b/clang/lib/Sema/IdentifierResolver.cpp index 773cef65dcbdf0..98a6f3b45089b3 100644 --- a/clang/lib/Sema/IdentifierResolver.cpp +++ b/clang/lib/Sema/IdentifierResolver.cpp @@ -60,6 +60,9 @@ class IdentifierResolver::IdDeclInfoMap { } } + 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