[clang] [analyzer] Handle builtin functions in MallocChecker (PR #88416)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 10:28:15 PDT 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 938a73422e0b964eba16f272acdfae1d0281772c da3b7d89dfa03555a39ff5f0b29cde225a8d6eda -- clang/test/Analysis/malloc-std-namespace.cpp clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp clang/test/Analysis/Inputs/system-header-simulator-cxx.h clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp clang/test/Analysis/exercise-ps.c clang/test/Analysis/explain-svals.cpp clang/test/Analysis/malloc.c clang/test/Analysis/malloc.cpp clang/test/Analysis/stack-addr-ps.c clang/test/Analysis/stackaddrleak.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index c141d6dcef..11651fd491 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -402,7 +402,8 @@ private:
 
   const CallDescriptionMap<CheckFn> FreeingMemFnMap{
       {{CDM::CLibrary, {"free"}, 1}, &MallocChecker::checkFree},
-      {{CDM::CLibrary, {"if_freenameindex"}, 1}, &MallocChecker::checkIfFreeNameIndex},
+      {{CDM::CLibrary, {"if_freenameindex"}, 1},
+       &MallocChecker::checkIfFreeNameIndex},
       {{CDM::CLibrary, {"kfree"}, 1}, &MallocChecker::checkFree},
       {{CDM::CLibrary, {"g_free"}, 1}, &MallocChecker::checkFree},
   };

``````````

</details>


https://github.com/llvm/llvm-project/pull/88416


More information about the cfe-commits mailing list