[Windows] Fix assertion failure when passing 'nul' in input to clang.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 29 Apr 2014 20:17:28 +0000 (20:17 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 29 Apr 2014 20:17:28 +0000 (20:17 +0000)
commit6149bc1e104d56274be18ac2270818cb6bd93091
treef6aaaa9edd75a46c2cd3cc1db6a1264bef12da2e
parent55deff895d80ffa815cdf3620031714109e88ee1
[Windows] Fix assertion failure when passing 'nul' in input to clang.

Before this patch, if 'nul' was passed in input to clang, function
getStatus() (in Path.inc) always returned an instance of file_status with
field 'nFileSizeHigh' and 'nFileSizeLow' left uninitialized.

This was causing the triggering of an assertion failure in MemoryBuffer.cpp due
to an invalid FileSize for device 'nul'.

This patch fixes the assertion failure modifying the constructors of class
file_status (in llvm/Support/FileSystem.h) so that every field of the class
gets initialized to zero by default.

A clang test will be submitted on a separate patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207575 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/FileSystem.h