Skip to content

Commit 759340b

Browse files
committed
[win/asan] GetInstructionSize: Support some more 10 or more 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. Fixes: #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 b69002a commit 759340b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler-rt/lib/interception/interception_win.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,21 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
916916
return 5;
917917
}
918918

919+
switch (0xFFFFFFFFFFFFULL & *(u64*)(address)) {
920+
case 0x841f0f2e6666: // 66 66 2e 0f 1f 84 YY XX XX XX XX
921+
// data16 cs nop WORD PTR [rax+rax*1 + XX XX XX XX]
922+
return 11;
923+
}
924+
925+
switch (*(u64*)(address)) {
926+
case 0x010101010101b848: // 48 b8 01 01 01 01 01 01 01 01
927+
// movabs rax,0x101010101010101
928+
return 10;
929+
case 0x841f0f2e66666666: // 66 66 66 66 2e 0f 1f 84 YY XX XX XX XX
930+
// data16 data16 data16 cs nop WORD PTR [rax+rax*1 + XX XX XX XX]
931+
return 13;
932+
}
933+
919934
#else
920935

921936
switch (*(u8*)address) {

0 commit comments

Comments
 (0)