[clang] [clang][analyzer][NFC] Use `*EofVal` instead of constant `-1` (PR #73072)
Ben Shi via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 21 19:02:47 PST 2023
https://github.com/benshi001 created https://github.com/llvm/llvm-project/pull/73072
None
>From 1079cdb578a434344ac525e32d9931325e6f3f6c Mon Sep 17 00:00:00 2001
From: Ben Shi <bennshi at tencent.com>
Date: Wed, 22 Nov 2023 11:00:50 +0800
Subject: [PATCH] [clang][analyzer][NFC] Use '*EofVal' instead of constant '-1'
---
clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index 1d53e59ca067c27..3d6f54c1b606ac0 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -952,8 +952,9 @@ void StreamChecker::evalFtell(const FnDescription *Desc, const CallEvent &Call,
if (!StateNotFailed)
return;
- ProgramStateRef StateFailed = State->BindExpr(
- CE, C.getLocationContext(), SVB.makeIntVal(-1, C.getASTContext().LongTy));
+ ProgramStateRef StateFailed =
+ State->BindExpr(CE, C.getLocationContext(),
+ SVB.makeIntVal(*EofVal, C.getASTContext().LongTy));
C.addTransition(StateNotFailed);
C.addTransition(StateFailed);
More information about the cfe-commits
mailing list