summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mac.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-02-19 11:30:25 +0000
committerKostya Serebryany <kcc@google.com>2013-02-19 11:30:25 +0000
commit366984e3aa286f7b4fb45f5c9e703f2768c407ed (patch)
tree859489af57c8982092e4fef057fb97953fd80faa /lib/asan/asan_mac.cc
parentf35eae83757946decb312deab3f0fe155fe5d580 (diff)
[asan] instrument memory accesses with unusual sizes
This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or packed structures. Instrumentation is done with two 1-byte checks (first and last bytes) and if the error is found __asan_report_load_n(addr, real_size) or __asan_report_store_n(addr, real_size) is called. asan-rt part Also fix lint. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_mac.cc')
-rw-r--r--lib/asan/asan_mac.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/asan/asan_mac.cc b/lib/asan/asan_mac.cc
index 154a33fc7..3aeb1a5db 100644
--- a/lib/asan/asan_mac.cc
+++ b/lib/asan/asan_mac.cc
@@ -114,7 +114,7 @@ void LeakyResetEnv(const char *name, const char *name_value) {
char **del = environ;
do {
del[0] = del[1];
- } while(*del++);
+ } while (*del++);
}
}
}
@@ -193,7 +193,8 @@ void MaybeReexec() {
if ((uptr)(piece_start - dyld_insert_libraries) > old_env_len) break;
uptr piece_len = piece_end - piece_start;
- // If the current piece isn't the runtime library name, append it to new_env.
+ // If the current piece isn't the runtime library name,
+ // append it to new_env.
if ((piece_len != fname_len) ||
(internal_strncmp(piece_start, info.dli_fname, fname_len) != 0)) {
if (new_env_pos != new_env + env_name_len + 1) {
@@ -202,7 +203,7 @@ void MaybeReexec() {
}
internal_strncpy(new_env_pos, piece_start, piece_len);
}
- // Move on to the next piece.
+ // Move on to the next piece.
new_env_pos += piece_len;
piece_start = piece_end;
} while (piece_start < old_env_end);