forked from OSchip/llvm-project
Turn an assert into report_fatal_error since it's reachable based on user input
Bug found with AFL fuzz. llvm-svn: 236076
This commit is contained in:
parent
ac3eca536d
commit
1351cba720
|
@ -199,7 +199,8 @@ unsigned BitstreamCursor::readRecord(unsigned AbbrevID,
|
||||||
unsigned NumElts = ReadVBR(6);
|
unsigned NumElts = ReadVBR(6);
|
||||||
|
|
||||||
// Get the element encoding.
|
// 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);
|
const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i);
|
||||||
if (EltEnc.getEncoding() == BitCodeAbbrevOp::Array ||
|
if (EltEnc.getEncoding() == BitCodeAbbrevOp::Array ||
|
||||||
EltEnc.getEncoding() == BitCodeAbbrevOp::Blob)
|
EltEnc.getEncoding() == BitCodeAbbrevOp::Blob)
|
||||||
|
|
Binary file not shown.
|
@ -105,3 +105,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-element-type.bc 2>&1
|
||||||
RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
|
RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
|
||||||
|
|
||||||
ELEMENT-TYPE: Invalid type
|
ELEMENT-TYPE: Invalid type
|
||||||
|
|
||||||
|
RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-op-not-2nd-to-last.bc 2>&1 | \
|
||||||
|
RUN: FileCheck --check-prefix=ARRAY-NOT-2LAST %s
|
||||||
|
|
||||||
|
ARRAY-NOT-2LAST: Array op not second to last
|
||||||
|
|
Loading…
Reference in New Issue