From d2f05f52b4bc046865daad00916a2a5fb7bdc3b9 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 21 Mar 2016 18:23:07 +0000 Subject: [PATCH] [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. llvm-svn: 263966 --- compiler-rt/lib/interception/interception_win.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler-rt/lib/interception/interception_win.cc b/compiler-rt/lib/interception/interception_win.cc index 4c04c83..fdecff2 100644 --- a/compiler-rt/lib/interception/interception_win.cc +++ b/compiler-rt/lib/interception/interception_win.cc @@ -119,6 +119,11 @@ static size_t RoundUpToInstrBoundary(size_t size, char *code) { 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 -- 2.7.4