diff options
author | Chris Bieneman <beanz@apple.com> | 2015-06-23 21:39:49 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-06-23 21:39:49 +0000 |
commit | e13272a008e345abeb818635ae8551b81b7b294a (patch) | |
tree | bab2f90ba97a74bf1f5dc7f38cdf6db20ac48e19 /compiler-rt/lib/asan/asan_mac.cc | |
parent | 0b90be1c4f151dd3f8eda2a291a68554e67a3742 (diff) | |
download | bcm5719-llvm-e13272a008e345abeb818635ae8551b81b7b294a.tar.gz bcm5719-llvm-e13272a008e345abeb818635ae8551b81b7b294a.zip |
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.
This change does the following:
- Don't include crt_externs on iOS (it isn't available)
- Support ARM thread state objects
Note: this change does not enable building for iOS, as there are more changes to come.
Reviewers: glider, kubabrecka, bogner, samsonov
Reviewed By: samsonov
Subscribers: samsonov, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D10510
llvm-svn: 240467
Diffstat (limited to 'compiler-rt/lib/asan/asan_mac.cc')
-rw-r--r-- | compiler-rt/lib/asan/asan_mac.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler-rt/lib/asan/asan_mac.cc b/compiler-rt/lib/asan/asan_mac.cc index b2618d7297f..f7b54f868ca 100644 --- a/compiler-rt/lib/asan/asan_mac.cc +++ b/compiler-rt/lib/asan/asan_mac.cc @@ -62,30 +62,27 @@ LowLevelAllocator allocator_for_env; // otherwise the corresponding "NAME=value" string is replaced with // |name_value|. void LeakyResetEnv(const char *name, const char *name_value) { - char ***env_ptr = _NSGetEnviron(); - CHECK(env_ptr); - char **environ = *env_ptr; - CHECK(environ); + char **env = GetEnviron(); uptr name_len = internal_strlen(name); - while (*environ != 0) { - uptr len = internal_strlen(*environ); + while (*env != 0) { + uptr len = internal_strlen(*env); if (len > name_len) { - const char *p = *environ; + const char *p = *env; if (!internal_memcmp(p, name, name_len) && p[name_len] == '=') { // Match. if (name_value) { // Replace the old value with the new one. - *environ = const_cast<char*>(name_value); + *env = const_cast<char*>(name_value); } else { // Shift the subsequent pointers back. - char **del = environ; + char **del = env; do { del[0] = del[1]; } while (*del++); } } } - environ++; + env++; } } |