mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-30 11:01:33 +00:00
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:
1 parent
84a2fe141a
commit
4a5c8c602c
1 file changed
+2
-2
@@ -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