Turn an assert into report_fatal_error since it's reachable based on user input
[oota-llvm.git] / lib / Bitcode / Reader / BitstreamReader.cpp
index 2f34532ae9357f7ec391a130cdcc6440515a10c5..dff6d181486a5320fa1f34a8fea063ed73036b24 100644 (file)
@@ -199,7 +199,8 @@ unsigned BitstreamCursor::readRecord(unsigned AbbrevID,
       unsigned NumElts = ReadVBR(6);
 
       // Get the element encoding.
-      assert(i+2 == e && "array op not second to last?");
+      if (i+2 != e)
+       report_fatal_error("Array op not second to last");
       const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i);
       if (EltEnc.getEncoding() == BitCodeAbbrevOp::Array ||
           EltEnc.getEncoding() == BitCodeAbbrevOp::Blob)