Skip to content

Commit b69002a

Browse files
committed
[win/asan] GetInstructionSize: Support some more 7 or 8 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: #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 cac58da commit b69002a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler-rt/lib/interception/interception_win.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
842842
return 6;
843843

844844
case 0xec8148: // 48 81 EC XX XX XX XX : sub rsp, XXXXXXXX
845+
case 0xc0c748: // 48 C7 C0 XX XX XX XX : mov rax, XX XX XX XX
845846
return 7;
846847

847848
// clang-format off
@@ -905,6 +906,8 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
905906
return 5;
906907
case 0x24648348: // 48 83 64 24 XX YY : and QWORD PTR [rsp + XX], YY
907908
return 6;
909+
case 0x24A48D48: // 48 8D A4 24 XX YY ZZ WW : lea rsp, [rsp + WWZZYYXX]
910+
return 8;
908911
}
909912

910913
switch (0xFFFFFFFFFFULL & *(u64*)(address)) {

0 commit comments

Comments
 (0)