I don't think we test invalid bitcode records in any detail, so no test
here - just a change for consistency with existing error checks in
surrounding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232215
91177308-0d34-0410-b5e6-
96231b3b80d8
}
I = GetElementPtrInst::Create(BasePtr, GEPIdx);
- (void)Ty;
- assert(!Ty || Ty == cast<GetElementPtrInst>(I)->getSourceElementType());
+ if (Ty && Ty != cast<GetElementPtrInst>(I)->getSourceElementType())
+ return Error("Invalid record");
InstructionList.push_back(I);
if (InBounds)
cast<GetElementPtrInst>(I)->setIsInBounds(true);