[compiler-rt] Refactor the interception code on windows.
authorEtienne Bergeron <etienneb@google.com>
Mon, 11 Jul 2016 20:37:12 +0000 (20:37 +0000)
committerEtienne Bergeron <etienneb@google.com>
Mon, 11 Jul 2016 20:37:12 +0000 (20:37 +0000)
commit81c0f32cf247b7c67d883bfd19508a7029ff6ed1
treeaa293e33a7b3c3e25f2bf5e2c838a45abd7174ee
parentf1996e567aa06ca3a5931baa697c1364ceb69420
[compiler-rt] Refactor the interception code on windows.

[asan] Fix unittest Asan-x86_64-inline-Test crashing on Windows64

REAL(memcpy) was used in several places in Asan, while REAL(memmove) was not used.
This CL chooses to patch memcpy() first, solving the crash for unittest.

The crash looks like this:

projects\compiler-rt\lib\asan\tests\default\Asan-x86_64-inline-Test.exe
=================================================================
==22680==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000000 (pc 0x000000000000 bp 0x0029d555f590 sp 0x0029d555f438 T0)
==22680==Hint: pc points to the zero page.

AddressSanitizer can not provide additional info.
 SUMMARY: AddressSanitizer: access-violation (<unknown module>)
==22680==ABORTING

Patch by: Wei Wang
Differential Revision: http://reviews.llvm.org/D22232

llvm-svn: 275098
compiler-rt/lib/asan/asan_interceptors.cc