[llvm-commits] [compiler-rt] r146263 - /compiler-rt/trunk/lib/asan/mach_override/mach_override.c

Kostya Serebryany kcc at google.com
Fri Dec 9 10:18:55 PST 2011


Author: kcc
Date: Fri Dec  9 12:18:54 2011
New Revision: 146263

URL: http://llvm.org/viewvc/llvm-project?rev=146263&view=rev
Log:
[asan]  fix asan-rt interceptors on Snow Leopard. Patch by glider at google.com

Modified:
    compiler-rt/trunk/lib/asan/mach_override/mach_override.c

Modified: compiler-rt/trunk/lib/asan/mach_override/mach_override.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/mach_override/mach_override.c?rev=146263&r1=146262&r2=146263&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/mach_override/mach_override.c (original)
+++ compiler-rt/trunk/lib/asan/mach_override/mach_override.c Fri Dec  9 12:18:54 2011
@@ -641,6 +641,8 @@
 // TODO(glider): disassembling the "0x48, 0x89" sequences is trickier than it's done below.
 // If it stops working, refer to http://ref.x86asm.net/geek.html#modrm_byte_32_64 to do it
 // more accurately.
+// Note: 0x48 is in fact the REX.W prefix, but it might be wrong to treat it as a separate
+// instruction.
 static AsmInstructionMatch possibleInstructions[] = {
 	{ 0x5, {0xFF, 0x00, 0x00, 0x00, 0x00}, {0xE9, 0x00, 0x00, 0x00, 0x00} },	// jmp 0x????????
 	{ 0x1, {0xFF}, {0x90} },							// nop
@@ -660,7 +662,7 @@
 	{ 0x2, {0xFF, 0xFF}, {0x31, 0xC0} },						// xor %eax, %eax
 	{ 0x5, {0xFF, 0x00, 0x00, 0x00, 0x00}, {0x25, 0x00, 0x00, 0x00, 0x00} },	// and $imm, %eax
 
-  { 0x8, {0xFF, 0xFF, 0x3F, 0xFF, 0x00, 0x00, 0x00, 0x00},
+  { 0x8, {0xFF, 0xFF, 0xCF, 0xFF, 0x00, 0x00, 0x00, 0x00},
          {0x48, 0x8B, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00}, },                     // mov $imm, %{rax,rdx,rsp,rsi}
   { 0x4, {0xFF, 0xFF, 0xFF, 0x00}, {0x48, 0x83, 0xFA, 0x00}, },   // cmp $i8, %rdx
 	{ 0x4, {0xFF, 0xFF, 0x00, 0x00}, {0x83, 0x7f, 0x00, 0x00}, },			// cmpl $imm, $imm(%rdi)





More information about the llvm-commits mailing list