[clang] [analyzer] Modernize, improve and promote chroot checker (PR #117791)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 26 13:06:40 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff cefc1b0c211fcc3f5528b72d5883f0c390d63e71 2fd9955af8fb56c83e399bb181f290165337dd3a --extensions c,cpp -- clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp clang/test/Analysis/chroot.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
index bf4d2af2ee..b450055a6f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
@@ -103,9 +103,9 @@ void ChrootChecker::evalChroot(const CallEvent &Call, CheckerContext &C) const {
const LocationContext *LCtx = C.getLocationContext();
NonLoc RetVal =
- C.getSValBuilder()
- .conjureSymbolVal(nullptr, ChrootCE, LCtx, sIntTy, C.blockCount())
- .castAs<NonLoc>();
+ C.getSValBuilder()
+ .conjureSymbolVal(nullptr, ChrootCE, LCtx, sIntTy, C.blockCount())
+ .castAs<NonLoc>();
ProgramStateRef StateChrootFailed, StateChrootSuccess;
std::tie(StateChrootFailed, StateChrootSuccess) = state->assume(RetVal);
@@ -183,7 +183,7 @@ void ChrootChecker::checkPreCall(const CallEvent &Call,
return;
// If jail state is ROOT_CHANGED, generate BugReport.
- //void *const* k = C.getState()->FindGDM(ChrootChecker::getTag());
+ // void *const* k = C.getState()->FindGDM(ChrootChecker::getTag());
const ChrootKind k = C.getState()->get<ChrootState>();
if (k == ROOT_CHANGED) {
ExplodedNode *Err =
``````````
</details>
https://github.com/llvm/llvm-project/pull/117791
More information about the cfe-commits
mailing list