[BitcodeReader] Make sure the type of the inserted value matches the type of the aggregate at those indices
Bug found with AFL-fuzz. llvm-svn: 237628
This commit is contained in:
@@ -3644,6 +3644,9 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
CurTy = CurTy->subtypes()[0];
|
||||
}
|
||||
|
||||
if (CurTy != Val->getType())
|
||||
return Error("Inserted value type doesn't match aggregate type");
|
||||
|
||||
I = InsertValueInst::Create(Agg, Val, INSERTVALIdx);
|
||||
InstructionList.push_back(I);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user