[clang] [clang][analyzer] Simplify method 'ensureStreamNonNull' of StreamChecker (PR #70927)
Ben Shi via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 1 05:09:08 PDT 2023
https://github.com/benshi001 created https://github.com/llvm/llvm-project/pull/70927
The passed in parameter 'State' is always identical to 'C.getState()'.
>From 48dc5f677a5d4eb5e2bc012665f69cc038a20407 Mon Sep 17 00:00:00 2001
From: Ben Shi <bennshi at tencent.com>
Date: Wed, 1 Nov 2023 17:32:10 +0800
Subject: [PATCH] [clang][analyzer] Simplify method 'ensureStreamNonNull' of
StreamChecker
The passed in parameter 'State' is always identical to 'C.getState()'.
---
clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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