Workaround an MSan false positive.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 14 Feb 2013 12:18:32 +0000 (12:18 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 14 Feb 2013 12:18:32 +0000 (12:18 +0000)
llvm-svn: 175156

llvm/lib/Support/Unix/Process.inc

index 1335b78e86b255b84f706460160a4a0055d6ff0d..9a4454f1c650e01a73f6c7fceacc9cf7f774ed7e 100644 (file)
@@ -224,6 +224,8 @@ static unsigned getColumns(int FileID) {
 #if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
   // Try to determine the width of the terminal.
   struct winsize ws;
+  // Zero-fill ws to avoid a false positive from MemorySanitizer.
+  memset(&ws, 0, sizeof(ws));
   if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)
     Columns = ws.ws_col;
 #endif