[clang] a623f4c - [NFC][clang] Fix static analyzer concerns
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 28 05:30:11 PDT 2023
Author: Podchishchaeva, Mariya
Date: 2023-07-28T05:29:56-07:00
New Revision: a623f4c7849838361c9a69324cf669100bc0e414
URL: https://github.com/llvm/llvm-project/commit/a623f4c7849838361c9a69324cf669100bc0e414
DIFF: https://github.com/llvm/llvm-project/commit/a623f4c7849838361c9a69324cf669100bc0e414.diff
LOG: [NFC][clang] Fix static analyzer concerns
DelegatingDeserializationListener 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/D156405
Added:
Modified:
clang/lib/Frontend/FrontendAction.cpp
Removed:
################################################################################
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index c6f958a6077bf6..f14557c316ec7a 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -61,6 +61,11 @@ class DelegatingDeserializationListener : public ASTDeserializationListener {
delete Previous;
}
+ DelegatingDeserializationListener(const DelegatingDeserializationListener &) =
+ delete;
+ DelegatingDeserializationListener &
+ operator=(const DelegatingDeserializationListener &) = delete;
+
void ReaderInitialized(ASTReader *Reader) override {
if (Previous)
Previous->ReaderInitialized(Reader);
More information about the cfe-commits
mailing list