[PATCH] D156904: [NFC][clang] Fix static analyzer concerns
Mariya Podchishchaeva via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 2 07:50:33 PDT 2023
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156904.546474.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230802/0d580de8/attachment-0001.bin>
More information about the cfe-commits
mailing list