================ @@ -121,17 +183,40 @@ void ChrootChecker::checkPreCall(const CallEvent &Call, return; // If jail state is ROOT_CHANGED, generate BugReport. - void *const* k = C.getState()->FindGDM(ChrootChecker::getTag()); - if (k) - if (isRootChanged((intptr_t) *k)) - if (ExplodedNode *N = C.generateNonFatalErrorNode()) { - constexpr llvm::StringLiteral Msg = - "No call of chdir(\"/\") immediately after chroot"; - C.emitReport( - std::make_unique<PathSensitiveBugReport>(BT_BreakJail, Msg, N)); - } + const ChrootKind k = C.getState()->get<ChrootState>(); + if (k == ROOT_CHANGED) { ---------------- steakhal wrote:
AFAICS we only do anything if this condition is met. I'd prefer an early return instead to reduce the indentation for the rest of the code. 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