Skip to content

Commit 48f93ac

Browse files
Reintroduce static, rename escapeArgsAfterIndex
1 parent a886005 commit 48f93ac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ using FnCheck = std::function<void(const StreamChecker *, const FnDescription *,
172172
const CallEvent &, CheckerContext &)>;
173173

174174
using ArgNoTy = unsigned int;
175-
const ArgNoTy ArgNone = std::numeric_limits<ArgNoTy>::max();
175+
static const ArgNoTy ArgNone = std::numeric_limits<ArgNoTy>::max();
176176

177177
struct FnDescription {
178178
FnCheck PreFn;
@@ -181,8 +181,9 @@ struct FnDescription {
181181
};
182182

183183
[[nodiscard]] ProgramStateRef
184-
escapeArgsAfterIndex(ProgramStateRef State, CheckerContext &C,
185-
const CallEvent &Call, unsigned FirstEscapingArgIndex) {
184+
escapeArgsStartingFromIndex(ProgramStateRef State, CheckerContext &C,
185+
const CallEvent &Call,
186+
unsigned FirstEscapingArgIndex) {
186187
const auto *CE = Call.getOriginExpr();
187188
assert(CE);
188189

@@ -1054,7 +1055,8 @@ void StreamChecker::evalFscanf(const FnDescription *Desc, const CallEvent &Call,
10541055
return;
10551056

10561057
// The pointers passed to fscanf escape and get invalidated.
1057-
State = escapeArgsAfterIndex(State, C, Call, /*FirstEscapingArgIndex=*/2);
1058+
State =
1059+
escapeArgsStartingFromIndex(State, C, Call, /*FirstEscapingArgIndex=*/2);
10581060

10591061
// Add the success state.
10601062
// In this context "success" means there is not an EOF or other read error

0 commit comments

Comments
 (0)