Skip to content

Commit 09ea725

Browse files
committed
NFC Reorder stuff
1 parent 9851a1d commit 09ea725

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ bool ChrootChecker::evalCall(const CallEvent &Call, CheckerContext &C) const {
7575
bool ChrootChecker::evalChroot(const CallEvent &Call, CheckerContext &C) const {
7676
BasicValueFactory &BVF = C.getSValBuilder().getBasicValueFactory();
7777
const LocationContext *LCtx = C.getLocationContext();
78+
ProgramStateRef State = C.getState();
7879

7980
// Using CallDescriptions to match on CallExpr, so no need
8081
// to do null checks.
@@ -84,10 +85,10 @@ bool ChrootChecker::evalChroot(const CallEvent &Call, CheckerContext &C) const {
8485
SVal Zero = nonloc::ConcreteInt{BVF.getValue(0, IntTy)};
8586
SVal Minus1 = nonloc::ConcreteInt{BVF.getValue(-1, IntTy)};
8687

87-
ProgramStateRef State = C.getState();
8888
ProgramStateRef ChrootFailed = State->BindExpr(CE, LCtx, Minus1);
89-
ProgramStateRef ChrootSucceeded = State->BindExpr(CE, LCtx, Zero);
9089
C.addTransition(ChrootFailed->set<ChrootState>(ROOT_CHANGE_FAILED));
90+
91+
ProgramStateRef ChrootSucceeded = State->BindExpr(CE, LCtx, Zero);
9192
C.addTransition(ChrootSucceeded->set<ChrootState>(ROOT_CHANGED));
9293
return true;
9394
}

0 commit comments

Comments
 (0)