hanchenye-llvm-project/compiler-rt/lib/asan/tests
Etienne Bergeron 8c6eb1566c [compiler-rt] Fix warnings in interception code
Summary:
This patch is re-introducing the code to fix the
dynamic hooking on windows and to fix a compiler
warning on Apple.

Related patches:

* https://reviews.llvm.org/D22641
* https://reviews.llvm.org/D22610
* https://reviews.llvm.org/rL276311
* https://reviews.llvm.org/rL276490

Both architecture are using different techniques to
hook on library functions (memchr, strcpy,...). 

On Apple, the function is not dynamically hooked and
the symbol always points to a valid function 
(i.e. can't be null). The REAL macro returns the
symbol.

On windows, the function is dynamically patch and the
REAL(...) function may or may not be null. It depend
on whether or not the function was hooked correctly.
Also, on windows memcpy and memmove are the same.

```
#if !defined(__APPLE__)
[...]
# define REAL(x) __interception::PTR_TO_REAL(x)
# define ASSIGN_REAL(dst, src) REAL(dst) = REAL(src)
[...]
#else  // __APPLE__
[...]
# define REAL(x) x
# define ASSIGN_REAL(x, y)
[...]
#endif  // __APPLE__

Reviewers: rnk

Subscribers: kcc, hans, kubabrecka, llvm-commits, bruno, chrisha

Differential Revision: https://reviews.llvm.org/D22758

llvm-svn: 276885
2016-07-27 16:16:54 +00:00
..
CMakeLists.txt [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
asan_asm_test.cc [asan] Fix >80 chars line. 2015-09-04 21:19:48 +00:00
asan_benchmarks_test.cc
asan_exceptions_test.cc
asan_fake_stack_test.cc
asan_globals_test.cc
asan_interface_test.cc [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across all sanitizers. 2015-08-21 20:49:37 +00:00
asan_mac_test.cc [ASan] Fix the links to bugs and wikipages. 2015-12-04 17:37:40 +00:00
asan_mac_test.h
asan_mac_test_helpers.mm
asan_mem_test.cc
asan_noinst_test.cc [sanitizer] On OS X, verify that interceptors work and abort if not, take 2 2016-03-17 08:37:25 +00:00
asan_oob_test.cc
asan_racy_double_free_test.cc
asan_str_test.cc [compiler-rt] Fix warnings in interception code 2016-07-27 16:16:54 +00:00
asan_test.cc [compiler-rt] Disable a test failing on windows. 2016-07-12 15:33:25 +00:00
asan_test.ignore
asan_test_config.h
asan_test_main.cc [sanitizer] On OS X, verify that interceptors work and abort if not, take 2 2016-03-17 08:37:25 +00:00
asan_test_utils.h