[clang] [clang][analyzer] Simplify method 'ensureStreamNonNull' of StreamChecker (PR #70927)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 1 05:10:19 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Ben Shi (benshi001)
<details>
<summary>Changes</summary>
The passed in parameter 'State' is always identical to 'C.getState()'.
---
Full diff: https://github.com/llvm/llvm-project/pull/70927.diff
1 Files Affected:
- (modified) clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (+1-1)
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index 4b7103c20557cc4..a5f8d855f8e06e1 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -1037,7 +1037,7 @@ StreamChecker::ensureStreamNonNull(SVal StreamVal, const Expr *StreamE,
ConstraintManager &CM = C.getConstraintManager();
ProgramStateRef StateNotNull, StateNull;
- std::tie(StateNotNull, StateNull) = CM.assumeDual(C.getState(), *Stream);
+ std::tie(StateNotNull, StateNull) = CM.assumeDual(State, *Stream);
if (!StateNotNull && StateNull) {
if (ExplodedNode *N = C.generateErrorNode(StateNull)) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/70927
More information about the cfe-commits
mailing list