Add testing for mismatched explicit type on a load instruction when loading from bitcode

llvm-svn: 232424
This commit is contained in:
David Blaikie
2015-03-16 21:48:46 +00:00
parent 73870dd438
commit c695cc7e58
3 changed files with 6 additions and 3 deletions

View File

@@ -3648,9 +3648,9 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
return EC;
I = new LoadInst(Op, "", Record[OpNum+1], Align);
(void)Ty;
assert((!Ty || Ty == I->getType()) &&
"Explicit type doesn't match pointee type of the first operand");
if (Ty && Ty != I->getType())
return Error("Explicit load type does not match pointee type of "
"pointer operand");
InstructionList.push_back(I);
break;