[compiler-rt] [win/asan] Recognize mov QWORD PTR [rip + X], reg (PR #117335)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 06:50:36 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-platform-windows

Author: Hans (zmodem)

<details>
<summary>Changes</summary>

This comes up when intercepting clang-built `__sanitizer_cov` functions.

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


1 Files Affected:

- (modified) compiler-rt/lib/interception/interception_win.cpp (+4) 


``````````diff
diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index ac81beee11a39c..8b8ce1abe906f6 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -816,6 +816,10 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
                       //   mov rax, QWORD PTR [rip + XXXXXXXX]
     case 0x058d48:    // 48 8d 05 XX XX XX XX :
                       //   lea rax, QWORD PTR [rip + XXXXXXXX]
+    case 0x0d8948:    // 48 89 0d XX XX XX XX :
+                      //   mov QWORD PTR [rip + XXXXXXXX], rcx
+    case 0x158948:    // 48 89 15 XX XX XX XX :
+                      //   mov QWORD PTR [rip + XXXXXXXX], rdx
     case 0x25ff48:    // 48 ff 25 XX XX XX XX :
                       //   rex.W jmp QWORD PTR [rip + XXXXXXXX]
     case 0x158D4C:    // 4c 8d 15 XX XX XX XX : lea r10, [rip + XX]

``````````

</details>


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


More information about the llvm-commits mailing list