[NFC][clang] Fix static analyzer concerns

TypeLocBuilder 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: aaron.ballman

Differential Revision: https://reviews.llvm.org/D156222
This commit is contained in:
Podchishchaeva, Mariya 2023-07-26 08:40:35 -07:00
parent 6c412b6c6f
commit cb63fa00d1

View File

@ -53,6 +53,9 @@ public:
delete[] Buffer;
}
TypeLocBuilder(const TypeLocBuilder &) = delete;
TypeLocBuilder &operator=(const TypeLocBuilder &) = delete;
/// Ensures that this buffer has at least as much capacity as described.
void reserve(size_t Requested) {
if (Requested > Capacity)