[llvm] r175156 - Workaround an MSan false positive.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Feb 14 04:18:32 PST 2013
Author: eugenis
Date: Thu Feb 14 06:18:32 2013
New Revision: 175156
URL: http://llvm.org/viewvc/llvm-project?rev=175156&view=rev
Log:
Workaround an MSan false positive.
Modified:
llvm/trunk/lib/Support/Unix/Process.inc
Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=175156&r1=175155&r2=175156&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Thu Feb 14 06:18:32 2013
@@ -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
More information about the llvm-commits
mailing list