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

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 13:09:51 PDT 2026


Author: David Justo
Date: 2026-06-08T13:09:46-07:00
New Revision: 3ca5b7dc4f50f5e1af51f25c2575c8fa509c24b7

URL: https://github.com/llvm/llvm-project/commit/3ca5b7dc4f50f5e1af51f25c2575c8fa509c24b7
DIFF: https://github.com/llvm/llvm-project/commit/3ca5b7dc4f50f5e1af51f25c2575c8fa509c24b7.diff

LOG: [ASan] add pattern 'cmp BYTE PTR [rdx], XX' to win instruction decoder (#202407)

**Context:** The ASan instruction decoder in `interception_win.cpp` has
a manual case-based list for each instruction pattern we expect to see
in function prologues.

Today, we have an instruction decoder for `cmp BYTE PTR [rcx], XX`, but
we do not have the equivalent for `cmp BYTE PTR [rdx], XX`. In recent
builds of Windows, that latter is now seen in `ucrtbase!strstr`.

**This PR** adds the missing case.

Added: 
    

Modified: 
    compiler-rt/lib/interception/interception_win.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index 8b95c5b90d12a..19bccb3566d72 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


        


More information about the llvm-commits mailing list