Author: Mike Rice
Date: 2024-04-24T08:31:45-07:00
New Revision: cd3e71fb7a5fed9a7e5ee54a2f956ce33b90b90c

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

LOG: [NFC][clang][analyzer] Initialize pointer field in 
StreamOperationEvaluator (#89837)

Add an initializer for StreamSym, which is a pointer. The pointers in
this class are set in the Init function, but all should be initialized
in the constructor to avoid confusion and static verifier hits.

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index bd495cd0f9710d..a0aa2316a7b45d 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -600,7 +600,7 @@ struct StreamOperationEvaluator {
   SValBuilder &SVB;
   const ASTContext &ACtx;
 
-  SymbolRef StreamSym;
+  SymbolRef StreamSym = nullptr;
   const StreamState *SS = nullptr;
   const CallExpr *CE = nullptr;
   StreamErrorState NewES;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to