Turn assertion into bitcode reading error
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. llvm-svn: 232215
This commit is contained in:
@@ -3126,8 +3126,8 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user