[clang] [clang][analyzer][NFC] Use `*EofVal` instead of constant `-1` (PR #73072)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 21 19:03:16 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Ben Shi (benshi001)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/73072.diff
1 Files Affected:
- (modified) clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (+3-2)
``````````diff
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);
``````````
</details>
https://github.com/llvm/llvm-project/pull/73072
More information about the cfe-commits
mailing list