[compiler-rt] r263966 - [asan] Update hotpatch code for VS 2015 memset implementation

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 11:23:08 PDT 2016


Author: rnk
Date: Mon Mar 21 13:23:07 2016
New Revision: 263966

URL: http://llvm.org/viewvc/llvm-project?rev=263966&view=rev
Log:
[asan] Update hotpatch code for VS 2015 memset implementation

In VS 2015, the memset fill parameter is zero extended from one byte
instead of being copied wholesale.

The issue reproduces with existing tests if you use VS2015.

Modified:
    compiler-rt/trunk/lib/interception/interception_win.cc

Modified: compiler-rt/trunk/lib/interception/interception_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_win.cc?rev=263966&r1=263965&r2=263966&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception_win.cc (original)
+++ compiler-rt/trunk/lib/interception/interception_win.cc Mon Mar 21 13:23:07 2016
@@ -119,6 +119,11 @@ static size_t RoundUpToInstrBoundary(siz
         cursor += 4;
         continue;
     }
+    switch (*(unsigned int *)(code + cursor)) {
+      case 0X2444B60F:  // 0F B6 44 24 XX = movzx eax, byte ptr [esp+XXh]
+        cursor += 5;
+        continue;
+    }
 
     // Unknown instruction!
     // FIXME: Unknown instruction failures might happen when we add a new




More information about the llvm-commits mailing list