[PATCH] D156406: [NFC][clang] Fix static analyzer concerns

Mariya Podchishchaeva via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 27 02:49:32 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.

IdentifierResolver 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/D156406

Files:
  clang/include/clang/Sema/IdentifierResolver.h


Index: clang/include/clang/Sema/IdentifierResolver.h
===================================================================
--- clang/include/clang/Sema/IdentifierResolver.h
+++ clang/include/clang/Sema/IdentifierResolver.h
@@ -134,6 +134,9 @@
   explicit IdentifierResolver(Preprocessor &PP);
   ~IdentifierResolver();
 
+  IdentifierResolver(const IdentifierResolver &) = delete;
+  IdentifierResolver &operator=(const IdentifierResolver &) = delete;
+
   /// Returns a range of decls with the name 'Name'.
   llvm::iterator_range<iterator> decls(DeclarationName Name);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156406.544670.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230727/6b60397e/attachment-0001.bin>


More information about the cfe-commits mailing list