Skip to content

Commit cac58da

Browse files
committed
[win/asan] GetInstructionSize: Support some more 6 byte instructions.
This patch adds several instructions seen when trying to run a executable built with ASan with llvm-mingw. (x86 and x86_64, using the git tip in llvm-project). Also includes instructions collected by Roman Pišl and Eric Pouech in the Wine bug reports below. Related: llvm#96270 Co-authored-by: Roman Pišl <[email protected]> https://bugs.winehq.org/show_bug.cgi?id=50993 https://bugs.winehq.org/attachment.cgi?id=70233 Co-authored-by: Eric Pouech <[email protected]> https://bugs.winehq.org/show_bug.cgi?id=52386 https://bugs.winehq.org/attachment.cgi?id=71626
1 parent 3cea0e7 commit cac58da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler-rt/lib/interception/interception_win.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,9 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
649649
case 0xC1F6: // F6 C1 XX : test cl, XX
650650
return 3;
651651

652+
case 0xEC81: // 81 EC XX XX XX XX : sub esp, XX XX XX XX
653+
return 6;
654+
652655
// Cannot overwrite control-instruction. Return 0 to indicate failure.
653656
case 0x25FF: // FF 25 XX YY ZZ WW : jmp dword ptr ds:[WWZZYYXX]
654657
return 0;
@@ -724,6 +727,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
724727
case 0x7980: // 80 79 YY XX cmp BYTE ptr [rcx+YY], XX
725728
return 4;
726729

730+
case 0xB841: // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
727731
case 0x058A: // 8A 05 XX XX XX XX : mov al, byte ptr [XX XX XX XX]
728732
case 0x058B: // 8B 05 XX XX XX XX : mov eax, dword ptr [XX XX XX XX]
729733
if (rel_offset)

0 commit comments

Comments
 (0)