[compiler-rt] [ASan] Recognize lea r10, [rip + XX] (PR #68910)

nicole mazzuca via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 09:28:16 PDT 2023


https://github.com/strega-nil created https://github.com/llvm/llvm-project/pull/68910

This instruction is present in memcpy in the latest vcruntime

This PR has been opened for Andrew Dean (a teammate inside Microsoft) who made the PR to our internal branch.

>From 159697e86cc85854ac2f9fd343539d689facc98c Mon Sep 17 00:00:00 2001
From: Andrew Dean <Andrew.Dean at microsoft.com>
Date: Wed, 23 Aug 2023 15:25:47 -0700
Subject: [PATCH] [ASan] Recognize lea r10, [rip + XX]

This instruction is present in memcpy in the latest vcruntime
---
 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 d57afa3fda7bcb8..1b681ada37b170d 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -624,7 +624,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
                       //   mov rax, QWORD PTR [rip + XXXXXXXX]
     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]
       // Instructions having offset relative to 'rip' need offset adjustment.
       if (rel_offset)
         *rel_offset = 3;



More information about the llvm-commits mailing list