diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-10-21 18:11:57 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-10-21 18:11:57 +0000 |
commit | 5e7ba22755b994e4f6aaf8cc00773c4d1b8dbf07 (patch) | |
tree | c9a6f8bba099c7227f4e16d1a572b64528e5e0da | |
parent | a650de81e9ce919edc876728fce7c1f4cdc4abcc (diff) | |
download | compiler-rt-5e7ba22755b994e4f6aaf8cc00773c4d1b8dbf07.tar.gz compiler-rt-5e7ba22755b994e4f6aaf8cc00773c4d1b8dbf07.tar.bz2 compiler-rt-5e7ba22755b994e4f6aaf8cc00773c4d1b8dbf07.tar.xz |
Use internal_memset to initialize this variable.
Otherwise, the compiler may use memset in non-optimized builds, which is
forbidden in the nolibc part of the runtime.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193098 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/sanitizer_common/sanitizer_linux.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc index a0600799..080945d2 100644 --- a/lib/sanitizer_common/sanitizer_linux.cc +++ b/lib/sanitizer_common/sanitizer_linux.cc @@ -218,7 +218,8 @@ uptr GetTid() { } u64 NanoTime() { - kernel_timeval tv = {}; + kernel_timeval tv; + internal_memset(&tv, 0, sizeof(tv)); internal_syscall(__NR_gettimeofday, &tv, 0); return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000; } |