diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-06-15 12:24:07 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-06-15 12:24:07 +0000 |
commit | 88207ab15125e2f1e9b3d541b735b2b8aba9b6d9 (patch) | |
tree | 17bb4198c23c32dccadfb66c504578ed8a7b3bf6 /lib/sanitizer_common/sanitizer_libc.cc | |
parent | 666772c9934fac81d457c74d3eeca381652d0873 (diff) |
[Sanitizer] Use DEFINE_REAL macro in TSan runtime to call libc implementations of functions. Move strchr to sanitizer_libc.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_libc.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_libc.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_libc.cc b/lib/sanitizer_common/sanitizer_libc.cc index 7eb7a54e2..898ca1931 100644 --- a/lib/sanitizer_common/sanitizer_libc.cc +++ b/lib/sanitizer_common/sanitizer_libc.cc @@ -75,6 +75,16 @@ int internal_strcmp(const char *s1, const char *s2) { return 0; } +char* internal_strchr(const char *s, int c) { + while (true) { + if (*s == (char)c) + return (char*)s; + if (*s == 0) + return 0; + s++; + } +} + char *internal_strrchr(const char *s, int c) { const char *res = 0; for (uptr i = 0; s[i]; i++) { |