Skip to content

Commit

Permalink
[NFC][clang] Fix static analyzer concerns
Browse files Browse the repository at this point in the history
EHScopeStack doesn't seem to be intended for copy. It frees memory in
the destructor and doesn't have user-written copy c'tor and assignment
operator, so delete them to avoid using default ones which would do
wrong.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D156133
  • Loading branch information
Fznamznon committed Jul 25, 2023
1 parent 4dbe2db commit c5a13e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/CodeGen/EHScopeStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ class EHScopeStack {
CGF(nullptr) {}
~EHScopeStack() { delete[] StartOfBuffer; }

EHScopeStack(const EHScopeStack &) = delete;
EHScopeStack &operator=(const EHScopeStack &) = delete;

/// Push a lazily-created cleanup on the stack.
template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
static_assert(alignof(T) <= ScopeStackAlignment,
Expand Down

0 comments on commit c5a13e2

Please sign in to comment.