[compiler-rt] [win/asan] Don't intercept memset etc. in ntdll (PR #120397)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 02:11:36 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 90968794e26709957d49dd660e4e453235d393e8 91b49f148e96297c1205405093dbb4afadb51d34 --extensions cpp -- compiler-rt/lib/interception/interception_win.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index 094953d354..7d2f23f649 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -1162,25 +1162,23 @@ bool OverrideFunction(
 
 static void **InterestingDLLsAvailable() {
   static const char *InterestingDLLs[] = {
-    "kernel32.dll",
-    "msvcr100d.dll",      // VS2010
-    "msvcr110d.dll",      // VS2012
-    "msvcr120d.dll",      // VS2013
-    "vcruntime140d.dll",  // VS2015
-    "ucrtbased.dll",      // Universal CRT
-    "msvcr100.dll",       // VS2010
-    "msvcr110.dll",       // VS2012
-    "msvcr120.dll",       // VS2013
-    "vcruntime140.dll",   // VS2015
-    "ucrtbase.dll",       // Universal CRT
+      "kernel32.dll",
+      "msvcr100d.dll",      // VS2010
+      "msvcr110d.dll",      // VS2012
+      "msvcr120d.dll",      // VS2013
+      "vcruntime140d.dll",  // VS2015
+      "ucrtbased.dll",      // Universal CRT
+      "msvcr100.dll",       // VS2010
+      "msvcr110.dll",       // VS2012
+      "msvcr120.dll",       // VS2013
+      "vcruntime140.dll",   // VS2015
+      "ucrtbase.dll",       // Universal CRT
 #  if (defined(__MINGW32__) && defined(__i386__))
-    "libc++.dll",     // libc++
-    "libunwind.dll",  // libunwind
+      "libc++.dll",     // libc++
+      "libunwind.dll",  // libunwind
 #  endif
-    // NTDLL must go last as it gets special treatment in OverrideFunction.
-    "ntdll.dll",
-    NULL
-  };
+      // NTDLL must go last as it gets special treatment in OverrideFunction.
+      "ntdll.dll", NULL};
   static void *result[ARRAY_SIZE(InterestingDLLs)] = { 0 };
   if (!result[0]) {
     for (size_t i = 0, j = 0; InterestingDLLs[i]; ++i) {
@@ -1280,9 +1278,7 @@ uptr InternalGetProcAddress(void *module, const char *func_name) {
 
 bool OverrideFunction(
     const char *func_name, uptr new_func, uptr *orig_old_func) {
-  static const char *kNtDllIgnore[] = {
-    "memcmp", "memcpy", "memmove", "memset"
-  };
+  static const char *kNtDllIgnore[] = {"memcmp", "memcpy", "memmove", "memset"};
 
   bool hooked = false;
   void **DLLs = InterestingDLLsAvailable();

``````````

</details>


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


More information about the llvm-commits mailing list