[clang] e98f3bf - [clang][analyzer]][NFC] Simplify method 'ensureStreamNonNull' of StreamChecker (#70927)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 1 23:41:37 PDT 2023
Author: Ben Shi
Date: 2023-11-02T14:41:33+08:00
New Revision: e98f3bfff2c499e76ce8784ea15cedbfb83b33bf
URL: https://github.com/llvm/llvm-project/commit/e98f3bfff2c499e76ce8784ea15cedbfb83b33bf
DIFF: https://github.com/llvm/llvm-project/commit/e98f3bfff2c499e76ce8784ea15cedbfb83b33bf.diff
LOG: [clang][analyzer]][NFC] Simplify method 'ensureStreamNonNull' of StreamChecker (#70927)
The passed in parameter 'State' is always identical to 'C.getState()'.
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 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)) {
More information about the cfe-commits
mailing list