Return the number of read bytes in MemoryObject::readBytes.
[oota-llvm.git] / lib / Bitcode / Reader / BitcodeReader.cpp
index 713b6a3a4e5ea77c909e3e4b0564f5dae764ee55..b2ca22c74ba6180c6067334be57af9ae2e313c6c 100644 (file)
@@ -3430,7 +3430,7 @@ std::error_code BitcodeReader::InitLazyStream() {
   Stream.init(&*StreamFile);
 
   unsigned char buf[16];
-  if (Bytes->readBytes(0, 16, buf) == -1)
+  if (Bytes->readBytes(buf, 16, 0) != 16)
     return Error(BitcodeError::InvalidBitcodeSignature);
 
   if (!isBitcode(buf, buf + 16))