[compiler-rt] [win/asan] Avoid warnings in compiling interception_win_test.cpp. (PR #116887)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 15:31:38 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (bernhardu)

<details>
<summary>Changes</summary>

Example:
  warning: unused variable 'kPatchableCode12' [-Wunused-const-variable]

---
Full diff: https://github.com/llvm/llvm-project/pull/116887.diff


1 Files Affected:

- (modified) compiler-rt/lib/interception/tests/interception_win_test.cpp (+6) 


``````````diff
diff --git a/compiler-rt/lib/interception/tests/interception_win_test.cpp b/compiler-rt/lib/interception/tests/interception_win_test.cpp
index c004d187768de6..17ff51457799e3 100644
--- a/compiler-rt/lib/interception/tests/interception_win_test.cpp
+++ b/compiler-rt/lib/interception/tests/interception_win_test.cpp
@@ -230,6 +230,7 @@ const u8 kUnpatchableCode6[] = {
     0x90, 0x90, 0x90, 0x90,
 };
 
+#if SANITIZER_WINDOWS64
 const u8 kUnpatchableCode7[] = {
     0x33, 0xc0,                     // xor     eax,eax
     0x48, 0x85, 0xd2,               // test    rdx,rdx
@@ -251,7 +252,9 @@ const u8 kUnpatchableCode9[] = {
     0x84, 0xc0,                     // test    al,al
     0x75, 0xf7,                     // jne     -9  (unpatchable)
 };
+#endif
 
+#if SANITIZER_WINDOWS64
 const u8 kPatchableCode6[] = {
     0x48, 0x89, 0x54, 0x24, 0xBB, // mov QWORD PTR [rsp + 0xBB], rdx
     0x33, 0xC9,                   // xor ecx,ecx
@@ -286,7 +289,9 @@ const u8 kPatchableCode11[] = {
     0x48, 0x83, 0xec, 0x38,         // sub     rsp,38h
     0x83, 0x64, 0x24, 0x28, 0x00,   // and     dword ptr [rsp+28h],0
 };
+#endif
 
+#if !SANITIZER_WINDOWS64
 const u8 kPatchableCode12[] = {
     0x55,                           // push    ebp
     0x53,                           // push    ebx
@@ -302,6 +307,7 @@ const u8 kPatchableCode13[] = {
     0x56,                           // push    esi
     0x8b, 0x5c, 0x24, 0x14,         // mov     ebx,dword ptr[esp+14h]
 };
+#endif
 
 const u8 kPatchableCode14[] = {
     0x55,                           // push    ebp

``````````

</details>


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


More information about the llvm-commits mailing list