[sanitizer] Add strlen to the common interceptors
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 11 Mar 2016 00:45:49 +0000 (00:45 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 11 Mar 2016 00:45:49 +0000 (00:45 +0000)
commited3d347e25d2de3aaf79e19de6d21739ec03fb84
treebf800181d4e435acccf20f5f747068b3081c0485
parent92a46991b521072598346b2d03b8d7ee2a425fbb
[sanitizer] Add strlen to the common interceptors

Summary:
Adds strlen to the common interceptors, under a new common flag
intercept_strlen.  This provides better sharing of interception code among
sanitizers and cleans up the inconsistent type declarations of the
previously duplicated interceptors.

Removes the now-duplicate strlen interceptor from asan, msan, and tsan.
The entry check semantics are normalized now for msan and asan, whose
private strlen interceptors contained multiple layers of checks that
included impossible-to-reach code.  The new semantics are identical to the
old: bypass interception if in the middle of init or if both on Mac and not
initialized; else, call the init routine and proceed.

Patch by Derek Bruening!

Reviewers: samsonov, vitalybuka

Subscribers: llvm-commits, kcc, zhaoqin

Differential Revision: http://reviews.llvm.org/D18020

llvm-svn: 263177
compiler-rt/lib/asan/asan_flags.cc
compiler-rt/lib/asan/asan_interceptors.cc
compiler-rt/lib/msan/msan_interceptors.cc
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
compiler-rt/lib/sanitizer_common/sanitizer_flags.inc
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc