mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-04 04:19:25 +00:00
Don't artifically restrict input object size.
sys::IdentifyFileType is already conscious of the length, and object_error::invalid_file_type is returned below anyway if sys::IdentifyFileType doesn't recognize the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183605 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -45,8 +45,6 @@ error_code object::createBinary(MemoryBuffer *Source,
|
|||||||
OwningPtr<MemoryBuffer> scopedSource(Source);
|
OwningPtr<MemoryBuffer> scopedSource(Source);
|
||||||
if (!Source)
|
if (!Source)
|
||||||
return make_error_code(errc::invalid_argument);
|
return make_error_code(errc::invalid_argument);
|
||||||
if (Source->getBufferSize() < 64)
|
|
||||||
return object_error::invalid_file_type;
|
|
||||||
sys::LLVMFileType type = sys::IdentifyFileType(Source->getBufferStart(),
|
sys::LLVMFileType type = sys::IdentifyFileType(Source->getBufferStart(),
|
||||||
static_cast<unsigned>(Source->getBufferSize()));
|
static_cast<unsigned>(Source->getBufferSize()));
|
||||||
error_code ec;
|
error_code ec;
|
||||||
|
Reference in New Issue
Block a user