Fznamznon created this revision.
Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, 
a.sidorin, baloghadamsoftware.
Herald added a reviewer: NoQ.
Herald added a project: All.
Fznamznon requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

CFGStmtMap 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/D156415

Files:
  clang/include/clang/Analysis/CFGStmtMap.h


Index: clang/include/clang/Analysis/CFGStmtMap.h
===================================================================
--- clang/include/clang/Analysis/CFGStmtMap.h
+++ clang/include/clang/Analysis/CFGStmtMap.h
@@ -26,6 +26,8 @@
   void *M;
 
   CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {}
+  CFGStmtMap(const CFGStmtMap &) = delete;
+  CFGStmtMap &operator=(const CFGStmtMap &) = delete;
 
 public:
   ~CFGStmtMap();


Index: clang/include/clang/Analysis/CFGStmtMap.h
===================================================================
--- clang/include/clang/Analysis/CFGStmtMap.h
+++ clang/include/clang/Analysis/CFGStmtMap.h
@@ -26,6 +26,8 @@
   void *M;
 
   CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {}
+  CFGStmtMap(const CFGStmtMap &) = delete;
+  CFGStmtMap &operator=(const CFGStmtMap &) = delete;
 
 public:
   ~CFGStmtMap();
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D156415: [NF... Mariya Podchishchaeva via Phabricator via cfe-commits

Reply via email to