Skip to content

Commit

Permalink
[NFC][analyzer] Fix static analyzer concerns
Browse files Browse the repository at this point in the history
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.

Reviewed By: cor3ntin

Differential Revision: https://reviews.llvm.org/D156415
  • Loading branch information
Fznamznon committed Jul 28, 2023
1 parent a623f4c commit 9fe23fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/include/clang/Analysis/CFGStmtMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class CFGStmtMap {
void *M;

CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {}
CFGStmtMap(const CFGStmtMap &) = delete;
CFGStmtMap &operator=(const CFGStmtMap &) = delete;

public:
~CFGStmtMap();
Expand Down

0 comments on commit 9fe23fb

Please sign in to comment.