[PATCH] D18020: [sanitizer] Add strlen to the common interceptors

Derek Bruening via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 17:43:43 PST 2016


bruening created this revision.
bruening added a reviewer: samsonov.
bruening added subscribers: zhaoqin, kcc, llvm-commits.

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.

Preserves asan's prior replace_str flag semantics by disabling
intercept_strlen when replace_str is disabled.

http://reviews.llvm.org/D18020

Files:
  lib/asan/asan_flags.cc
  lib/asan/asan_interceptors.cc
  lib/msan/msan_interceptors.cc
  lib/sanitizer_common/sanitizer_common_interceptors.inc
  lib/sanitizer_common/sanitizer_flags.inc
  lib/sanitizer_common/sanitizer_platform_interceptors.h
  lib/tsan/rtl/tsan_interceptors.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18020.50219.patch
Type: text/x-patch
Size: 6782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/d3565805/attachment.bin>


More information about the llvm-commits mailing list