[compiler-rt] [win/asan] GetInstructionSize: Make `F6 C1 XX` a generic entry. (PR #118144)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 29 15:36:07 PST 2024
https://github.com/bernhardu created https://github.com/llvm/llvm-project/pull/118144
None
>From 5c7c27ffd2aa6fe21b97b1da7137d5db1b6e89c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu at mailbox.org>
Date: Wed, 6 Nov 2024 22:21:14 +0100
Subject: [PATCH] [win/asan] GetInstructionSize: Make `F6 C1 XX` a generic
entry.
---
compiler-rt/lib/interception/interception_win.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index dc3018a675dee2..e3c3764c45417f 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -634,6 +634,9 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
case 0xD284: // 84 D2 : test dl,dl
return 2;
+ case 0xC1F6: // F6 C1 XX : test cl, XX
+ return 3;
+
// Cannot overwrite control-instruction. Return 0 to indicate failure.
case 0x25FF: // FF 25 XX YY ZZ WW : jmp dword ptr ds:[WWZZYYXX]
return 0;
@@ -724,7 +727,6 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
}
switch (0x00FFFFFF & *(u32*)address) {
- case 0x07c1f6: // f6 c1 07 : test cl, 0x7
case 0x10b70f: // 0f b7 10 : movzx edx, WORD PTR [rax]
case 0xc00b4d: // 4d 0b c0 : or r8, r8
case 0xc03345: // 45 33 c0 : xor r8d, r8d
More information about the llvm-commits
mailing list