Skip to content

Commit

Permalink
[clang][analyzer][NFC] Supplement comments in evalFtell of StreamCh…
Browse files Browse the repository at this point in the history
…ecker (llvm#74291)
  • Loading branch information
benshi001 authored Dec 6, 2023
1 parent f5adb5b commit 4699789
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4699789

Please sign in to comment.