Skip to content

Commit f38dd00

Browse files
committed
[win/asan] GetInstructionSize: Fix 8D A4 24 ... to return rel_offset=3.
1 parent 08379d6 commit f38dd00

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler-rt/lib/interception/interception_win.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,8 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
646646

647647
switch (0x00FFFFFF & *(u32 *)address) {
648648
case 0x24A48D: // 8D A4 24 XX XX XX XX : lea esp, [esp + XX XX XX XX]
649+
if (rel_offset)
650+
*rel_offset = 3;
649651
return 7;
650652
}
651653

compiler-rt/lib/interception/tests/interception_win_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ const struct InstructionSizeData {
858858
{ 5, {0x68, 0x71, 0x72, 0x73, 0x74}, 0, "68 XX XX XX XX : push imm32"},
859859
{ 5, {0xb8, 0x71, 0x72, 0x73, 0x74}, 0, "b8 XX XX XX XX : mov eax, XX XX XX XX"},
860860
{ 5, {0xB9, 0x71, 0x72, 0x73, 0x74}, 0, "b9 XX XX XX XX : mov ecx, XX XX XX XX"},
861+
{ 7, {0x8D, 0xA4, 0x24, 0x73, 0x74, 0x75, 0x76}, 3, "8D A4 24 XX XX XX XX : lea esp, [esp + XX XX XX XX]"},
861862
#if SANITIZER_WINDOWS_x64
862863
// sorted list
863864
{ 2, {0x40, 0x50}, 0, "40 50 : push rax"},

0 commit comments

Comments
 (0)