[clang] 4699789 - [clang][analyzer][NFC] Supplement comments in `evalFtell` of StreamChecker (#74291)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 5 18:26:37 PST 2023
Author: Ben Shi
Date: 2023-12-06T10:26:30+08:00
New Revision: 4699789249e6945c46cdbecd1fee493cbe553c66
URL: https://github.com/llvm/llvm-project/commit/4699789249e6945c46cdbecd1fee493cbe553c66
DIFF: https://github.com/llvm/llvm-project/commit/4699789249e6945c46cdbecd1fee493cbe553c66.diff
LOG: [clang][analyzer][NFC] Supplement comments in `evalFtell` of StreamChecker (#74291)
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 a4799b5f762ca..925fc90e35543 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -1072,6 +1072,9 @@ void StreamChecker::evalFtell(const FnDescription *Desc, const CallEvent &Call,
ProgramStateRef StateFailed = State->BindExpr(
CE, C.getLocationContext(), SVB.makeIntVal(-1, C.getASTContext().LongTy));
+ // This function does not affect the stream state.
+ // Still we add success and failure state with the appropriate return value.
+ // StdLibraryFunctionsChecker can change these states (set the 'errno' state).
C.addTransition(StateNotFailed);
C.addTransition(StateFailed);
}
More information about the cfe-commits
mailing list