Remove a couple of memset usages from TSan, introduced in r288624.
authorDaniel Jasper <djasper@google.com>
Mon, 5 Dec 2016 14:37:42 +0000 (14:37 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 5 Dec 2016 14:37:42 +0000 (14:37 +0000)
TSan runtime shouldn't contain memset, so internal_memset is used
instead and syntax that emits memset is avoided.

This doesn't fail in-tree due to TSan being build with -03, but it fails
when TSan is built with -O0, and is (I think) a true positive.

Patch by Sam McCall, review: https://reviews.llvm.org/D27407

llvm-svn: 288672

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc

index c041de3..dce73ed 100644 (file)
@@ -152,8 +152,10 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {
 
   int pid = -1;
 
-  int infd[2] = {};
-  int outfd[2] = {};
+  int infd[2];
+  internal_memset(&infd, 0, sizeof(infd));
+  int outfd[2];
+  internal_memset(&outfd, 0, sizeof(outfd));
   if (!CreateTwoHighNumberedPipes(infd, outfd)) {
     Report("WARNING: Can't create a socket pair to start "
            "external symbolizer (errno: %d)\n", errno);