[clang] 962dede - [NFC][clang] Fix static analyzer concerns
via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 3 01:52:58 PDT 2023
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);
More information about the cfe-commits
mailing list