It can be triggered by user input.
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238272
91177308-0d34-0410-b5e6-
96231b3b80d8
resize(Idx + 1);
if (Value *V = ValuePtrs[Idx]) {
- assert(Ty == V->getType() && "Type mismatch in constant table!");
+ if (Ty != V->getType())
+ report_fatal_error("Type mismatch in constant table!");
return cast<Constant>(V);
}
FWDREF-TYPE: Invalid record
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch-2.bc 2>&1 | \
+RUN: FileCheck --check-prefix=FWDREF-TYPE-MISMATCH %s
+
+FWDREF-TYPE-MISMATCH: Type mismatch in constant table!
+
RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-element-type.bc 2>&1 | \
RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-element-type.bc 2>&1 | \