================ @@ -80,19 +88,53 @@ bool ChrootChecker::evalCall(const CallEvent &Call, CheckerContext &C) const { void ChrootChecker::evalChroot(const CallEvent &Call, CheckerContext &C) const { ProgramStateRef state = C.getState(); ProgramStateManager &Mgr = state->getStateManager(); + const TargetInfo &TI = C.getASTContext().getTargetInfo(); + SValBuilder &SVB = C.getSValBuilder(); + BasicValueFactory &BVF = SVB.getBasicValueFactory(); + ConstraintManager &CM = Mgr.getConstraintManager(); - // Once encouter a chroot(), set the enum value ROOT_CHANGED directly in - // the GDM. - state = Mgr.addGDM(state, ChrootChecker::getTag(), (void*) ROOT_CHANGED); - C.addTransition(state); + const QualType sIntTy = C.getASTContext().getIntTypeForBitwidth( + /*DestWidth=*/TI.getIntWidth(), /*Signed=*/true); + + const Expr *ChrootCE = Call.getOriginExpr(); + if (!ChrootCE) + return; + const auto *CE = cast<CallExpr>(Call.getOriginExpr()); + + const LocationContext *LCtx = C.getLocationContext(); + NonLoc RetVal = + C.getSValBuilder() + .conjureSymbolVal(nullptr, ChrootCE, LCtx, sIntTy, C.blockCount()) + .castAs<NonLoc>(); + + ProgramStateRef StateChrootFailed, StateChrootSuccess; + std::tie(StateChrootFailed, StateChrootSuccess) = state->assume(RetVal); ---------------- steakhal wrote:
```suggestion auto [ChrootFailed, ChrootSucceeded] = state->assume(RetVal); ``` https://github.com/llvm/llvm-project/pull/117791 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits