From c695cc7e589bd8b0380216ca875b1eaea6d10703 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 16 Mar 2015 21:48:46 +0000 Subject: Add testing for mismatched explicit type on a load instruction when loading from bitcode llvm-svn: 232424 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index a26c444c..dd42bdb 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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; -- cgit v1.1