From 5e7ba22755b994e4f6aaf8cc00773c4d1b8dbf07 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Mon, 21 Oct 2013 18:11:57 +0000 Subject: 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 --- lib/sanitizer_common/sanitizer_linux.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3