[clang] c4bb3e0 - [NFC][clang] Fix static analyzer concerns

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 3 02:00:35 PDT 2023


Author: Podchishchaeva, Mariya
Date: 2023-08-03T02:00:17-07:00
New Revision: c4bb3e073548cf436d5fa0406e3ae75e94684dec

URL: https://github.com/llvm/llvm-project/commit/c4bb3e073548cf436d5fa0406e3ae75e94684dec
DIFF: https://github.com/llvm/llvm-project/commit/c4bb3e073548cf436d5fa0406e3ae75e94684dec.diff

LOG: [NFC][clang] Fix static analyzer concerns

InterpState 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/D156900

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpState.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpState.h b/clang/lib/AST/Interp/InterpState.h
index fc28c74002d9dd..8f84bf6ed2eaff 100644
--- a/clang/lib/AST/Interp/InterpState.h
+++ b/clang/lib/AST/Interp/InterpState.h
@@ -39,6 +39,9 @@ class InterpState final : public State, public SourceMapper {
 
   ~InterpState();
 
+  InterpState(const InterpState &) = delete;
+  InterpState &operator=(const InterpState &) = delete;
+
   // Stack frame accessors.
   Frame *getSplitFrame() { return Parent.getCurrentFrame(); }
   Frame *getCurrentFrame() override;


        


More information about the cfe-commits mailing list