Skip to content

Commit 368da2e

Browse files
committed
[win/asan] GetInstructionSize: Avoid warnings in compiling test.
E.g.: warning: unused variable 'kPatchableCode12'
1 parent 19dd8b5 commit 368da2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler-rt/lib/interception/tests/interception_win_test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ const u8 kUnpatchableCode6[] = {
230230
0x90, 0x90, 0x90, 0x90,
231231
};
232232

233+
#if SANITIZER_WINDOWS64
233234
const u8 kUnpatchableCode7[] = {
234235
0x33, 0xc0, // xor eax,eax
235236
0x48, 0x85, 0xd2, // test rdx,rdx
@@ -251,7 +252,9 @@ const u8 kUnpatchableCode9[] = {
251252
0x84, 0xc0, // test al,al
252253
0x75, 0xf7, // jne -9 (unpatchable)
253254
};
255+
#endif
254256

257+
#if SANITIZER_WINDOWS64
255258
const u8 kPatchableCode6[] = {
256259
0x48, 0x89, 0x54, 0x24, 0xBB, // mov QWORD PTR [rsp + 0xBB], rdx
257260
0x33, 0xC9, // xor ecx,ecx
@@ -286,7 +289,9 @@ const u8 kPatchableCode11[] = {
286289
0x48, 0x83, 0xec, 0x38, // sub rsp,38h
287290
0x83, 0x64, 0x24, 0x28, 0x00, // and dword ptr [rsp+28h],0
288291
};
292+
#endif
289293

294+
#if !SANITIZER_WINDOWS64
290295
const u8 kPatchableCode12[] = {
291296
0x55, // push ebp
292297
0x53, // push ebx
@@ -302,6 +307,7 @@ const u8 kPatchableCode13[] = {
302307
0x56, // push esi
303308
0x8b, 0x5c, 0x24, 0x14, // mov ebx,dword ptr[esp+14h]
304309
};
310+
#endif
305311

306312
const u8 kPatchableCode14[] = {
307313
0x55, // push ebp

0 commit comments

Comments
 (0)