mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
[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
This commit is contained in:
parent
55deff895d
commit
6149bc1e10
@ -165,15 +165,30 @@ class file_status
|
|||||||
file_type Type;
|
file_type Type;
|
||||||
perms Perms;
|
perms Perms;
|
||||||
public:
|
public:
|
||||||
file_status() : Type(file_type::status_error) {}
|
|
||||||
file_status(file_type Type) : Type(Type) {}
|
|
||||||
|
|
||||||
#if defined(LLVM_ON_UNIX)
|
#if defined(LLVM_ON_UNIX)
|
||||||
|
file_status() : fs_st_dev(0), fs_st_ino(0), fs_st_mtime(0),
|
||||||
|
fs_st_uid(0), fs_st_gid(0), fs_st_size(0),
|
||||||
|
Type(file_type::status_error), Perms(perms_not_known) {}
|
||||||
|
|
||||||
|
file_status(file_type Type) : fs_st_dev(0), fs_st_ino(0), fs_st_mtime(0),
|
||||||
|
fs_st_uid(0), fs_st_gid(0), fs_st_size(0), Type(Type),
|
||||||
|
Perms(perms_not_known) {}
|
||||||
|
|
||||||
file_status(file_type Type, perms Perms, dev_t Dev, ino_t Ino, time_t MTime,
|
file_status(file_type Type, perms Perms, dev_t Dev, ino_t Ino, time_t MTime,
|
||||||
uid_t UID, gid_t GID, off_t Size)
|
uid_t UID, gid_t GID, off_t Size)
|
||||||
: fs_st_dev(Dev), fs_st_ino(Ino), fs_st_mtime(MTime), fs_st_uid(UID),
|
: fs_st_dev(Dev), fs_st_ino(Ino), fs_st_mtime(MTime), fs_st_uid(UID),
|
||||||
fs_st_gid(GID), fs_st_size(Size), Type(Type), Perms(Perms) {}
|
fs_st_gid(GID), fs_st_size(Size), Type(Type), Perms(Perms) {}
|
||||||
#elif defined(LLVM_ON_WIN32)
|
#elif defined(LLVM_ON_WIN32)
|
||||||
|
file_status() : LastWriteTimeHigh(0), LastWriteTimeLow(0),
|
||||||
|
VolumeSerialNumber(0), FileSizeHigh(0), FileSizeLow(0),
|
||||||
|
FileIndexHigh(0), FileIndexLow(0), Type(file_type::status_error),
|
||||||
|
Perms(perms_not_known) {}
|
||||||
|
|
||||||
|
file_status(file_type Type) : LastWriteTimeHigh(0), LastWriteTimeLow(0),
|
||||||
|
VolumeSerialNumber(0), FileSizeHigh(0), FileSizeLow(0),
|
||||||
|
FileIndexHigh(0), FileIndexLow(0), Type(Type),
|
||||||
|
Perms(perms_not_known) {}
|
||||||
|
|
||||||
file_status(file_type Type, uint32_t LastWriteTimeHigh,
|
file_status(file_type Type, uint32_t LastWriteTimeHigh,
|
||||||
uint32_t LastWriteTimeLow, uint32_t VolumeSerialNumber,
|
uint32_t LastWriteTimeLow, uint32_t VolumeSerialNumber,
|
||||||
uint32_t FileSizeHigh, uint32_t FileSizeLow,
|
uint32_t FileSizeHigh, uint32_t FileSizeLow,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user