[compiler-rt] [ASan] add pattern 'cmp BYTE PTR [rdx], XX' to win instruction decoder (PR #202407)

David Justo via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 11:57:08 PDT 2026


https://github.com/davidmrdavid updated https://github.com/llvm/llvm-project/pull/202407

>From a1cbe52bbf872ee87d674b0420162dc9a638f695 Mon Sep 17 00:00:00 2001
From: David Justo <david.justo.1996 at gmail.com>
Date: Mon, 8 Jun 2026 11:30:40 -0700
Subject: [PATCH 1/2] add pattern 'cmp BYTE PTR [rdx], XX' to win instruction
 decoder

---
 compiler-rt/lib/interception/interception_win.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index 8b95c5b90d12a..e9477f2e013df 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -679,6 +679,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
       return 2;
 
     case 0x3980:  // 80 39 XX : cmp BYTE PTR [rcx], XX
+    case 0x3a80:  // 80 3a XX : cmp BYTE PTR [rdx], XX
     case 0x4D8B:  // 8B 4D XX : mov XX(%ebp), ecx
     case 0x558B:  // 8B 55 XX : mov XX(%ebp), edx
     case 0x758B:  // 8B 75 XX : mov XX(%ebp), esp

>From c38d3b06db55f78736b8b96e4bd14ea4148ee716 Mon Sep 17 00:00:00 2001
From: David Justo <david.justo.1996 at gmail.com>
Date: Mon, 8 Jun 2026 11:33:28 -0700
Subject: [PATCH 2/2] style nit: capitalize hex digits

---
 compiler-rt/lib/interception/interception_win.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index e9477f2e013df..19bccb3566d72 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -679,7 +679,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
       return 2;
 
     case 0x3980:  // 80 39 XX : cmp BYTE PTR [rcx], XX
-    case 0x3a80:  // 80 3a XX : cmp BYTE PTR [rdx], XX
+    case 0x3a80:  // 80 3A XX : cmp BYTE PTR [rdx], XX
     case 0x4D8B:  // 8B 4D XX : mov XX(%ebp), ecx
     case 0x558B:  // 8B 55 XX : mov XX(%ebp), edx
     case 0x758B:  // 8B 75 XX : mov XX(%ebp), esp



More information about the llvm-commits mailing list