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