[compiler-rt] [win/asan] GetInstructionSize: Support the instruction `0f 29 74 24 XX`. (PR #152361)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 11:36:05 PDT 2025


https://github.com/bernhardu updated https://github.com/llvm/llvm-project/pull/152361

>From 4cb22d44348c3fbf66d39e37fd7bf2efb01dddc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu at mailbox.org>
Date: Tue, 5 Aug 2025 23:27:20 +0200
Subject: [PATCH] [win/asan] GetInstructionSize: Support the instruction `0f 29
 74 24 XX`.

---
 compiler-rt/lib/interception/interception_win.cpp            | 5 +++++
 compiler-rt/lib/interception/tests/interception_win_test.cpp | 1 +
 2 files changed, 6 insertions(+)

diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index 246a22c56c31a..5bf1ee2ac48f9 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -684,6 +684,11 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
       return 3;
   }
 
+  switch (*(u32 *)address) {
+    case 0x2474290f:  // 0f 29 74 24 XX : movaps %xmm6, XX(%rsp)
+      return 5;
+  }
+
 #  if SANITIZER_WINDOWS_x64
   switch (*(u8*)address) {
     case 0xA1:  // A1 XX XX XX XX XX XX XX XX :
diff --git a/compiler-rt/lib/interception/tests/interception_win_test.cpp b/compiler-rt/lib/interception/tests/interception_win_test.cpp
index f11c1d1458556..ef1e94d02b793 100644
--- a/compiler-rt/lib/interception/tests/interception_win_test.cpp
+++ b/compiler-rt/lib/interception/tests/interception_win_test.cpp
@@ -867,6 +867,7 @@ const struct InstructionSizeData {
     { 3, {0xc2, 0x71, 0x72}, 0, "C2 XX XX : ret XX (needed for registering weak functions)"},
     { 4, {0x8D, 0x4C, 0x24, 0x73}, 0, "8D 4C 24 XX : lea ecx, [esp + XX]"},
     { 4, {0xFF, 0x74, 0x24, 0x73}, 0, "FF 74 24 XX : push qword ptr [rsp + XX]"},
+    { 5, {0x0f, 0x29, 0x74, 0x24, 0x74}, 0, "0f 29 74 24 XX : movaps %xmm6, XX(%rsp)"},
     { 5, {0x68, 0x71, 0x72, 0x73, 0x74}, 0, "68 XX XX XX XX : push imm32"},
     { 5, {0xb8, 0x71, 0x72, 0x73, 0x74}, 0, "b8 XX XX XX XX : mov eax, XX XX XX XX"},
     { 5, {0xB9, 0x71, 0x72, 0x73, 0x74}, 0, "b9 XX XX XX XX : mov ecx, XX XX XX XX"},



More information about the llvm-commits mailing list