[llvm] r183605 - Don't artifically restrict input object size.

Sean Silva silvas at purdue.edu
Fri Jun 7 21:32:59 PDT 2013


Author: silvas
Date: Fri Jun  7 23:32:59 2013
New Revision: 183605

URL: http://llvm.org/viewvc/llvm-project?rev=183605&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Object/Binary.cpp

Modified: llvm/trunk/lib/Object/Binary.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Binary.cpp?rev=183605&r1=183604&r2=183605&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Binary.cpp (original)
+++ llvm/trunk/lib/Object/Binary.cpp Fri Jun  7 23:32:59 2013
@@ -45,8 +45,6 @@ error_code object::createBinary(MemoryBu
   OwningPtr<MemoryBuffer> scopedSource(Source);
   if (!Source)
     return make_error_code(errc::invalid_argument);
-  if (Source->getBufferSize() < 64)
-    return object_error::invalid_file_type;
   sys::LLVMFileType type = sys::IdentifyFileType(Source->getBufferStart(),
                                 static_cast<unsigned>(Source->getBufferSize()));
   error_code ec;





More information about the llvm-commits mailing list