[PATCH] D156405: [NFC][clang] Fix static analyzer concerns
Mariya Podchishchaeva via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 27 02:34:47 PDT 2023
Fznamznon created this revision.
Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware.
Herald added a project: All.
Fznamznon requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D156405
Files:
clang/lib/Frontend/FrontendAction.cpp
Index: clang/lib/Frontend/FrontendAction.cpp
===================================================================
--- clang/lib/Frontend/FrontendAction.cpp
+++ clang/lib/Frontend/FrontendAction.cpp
@@ -61,6 +61,11 @@
delete Previous;
}
+ DelegatingDeserializationListener(const DelegatingDeserializationListener &) =
+ delete;
+ DelegatingDeserializationListener &
+ operator=(const DelegatingDeserializationListener &) = delete;
+
void ReaderInitialized(ASTReader *Reader) override {
if (Previous)
Previous->ReaderInitialized(Reader);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156405.544665.patch
Type: text/x-patch
Size: 570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230727/33f0f4b8/attachment.bin>
More information about the cfe-commits
mailing list