Bug found with AFL fuzz.
llvm-svn: 236193
Type *Ty = nullptr;
if (OpNum + 3 == Record.size())
Ty = getTypeByID(Record[OpNum++]);
+ if (!isa<PointerType>(Op->getType()))
+ return Error("Load operand is not a pointer type");
if (!Ty)
Ty = cast<PointerType>(Op->getType())->getElementType();
else if (Ty != cast<PointerType>(Op->getType())->getElementType())
RUN: FileCheck --check-prefix=HUGE-FWDREF %s
HUGE-FWDREF: Invalid record
+
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-pointer-type.bc 2>&1 | \
+RUN: FileCheck --check-prefix=LOAD-BAD-TYPE %s
+
+LOAD-BAD-TYPE: Load operand is not a pointer type