Skip to content

Commit 25e7bb3

Browse files
Remove use of llvm::make_scope_exit
1 parent e9c7010 commit 25e7bb3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
2222
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
2323
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
24-
#include "llvm/ADT/ScopeExit.h"
2524
#include "llvm/ADT/Sequence.h"
2625
#include <functional>
2726
#include <optional>
@@ -1257,12 +1256,6 @@ void StreamChecker::preGetdelim(const FnDescription *Desc,
12571256
ProgramStateRef State = C.getState();
12581257
SVal StreamVal = getStreamArg(Desc, Call);
12591258

1260-
auto AddTransitionOnReturn = llvm::make_scope_exit([&] {
1261-
if (State != nullptr) {
1262-
C.addTransition(State);
1263-
}
1264-
});
1265-
12661259
State = ensureStreamNonNull(StreamVal, Call.getArgExpr(Desc->StreamArgNo), C,
12671260
State);
12681261
if (!State)
@@ -1299,6 +1292,8 @@ void StreamChecker::preGetdelim(const FnDescription *Desc,
12991292
if (SS->ErrorState & ErrorFEof)
13001293
reportFEofWarning(Sym, C, State);
13011294
}
1295+
1296+
C.addTransition(State);
13021297
}
13031298

13041299
void StreamChecker::evalGetdelim(const FnDescription *Desc,

0 commit comments

Comments
 (0)