[BitcodeReader] Error out if we read an invalid function argument type
Bug found with AFL fuzz. llvm-svn: 237650
This commit is contained in:
@@ -1402,8 +1402,11 @@ std::error_code BitcodeReader::ParseTypeTableBody() {
|
||||
return Error("Invalid record");
|
||||
SmallVector<Type*, 8> ArgTys;
|
||||
for (unsigned i = 2, e = Record.size(); i != e; ++i) {
|
||||
if (Type *T = getTypeByID(Record[i]))
|
||||
if (Type *T = getTypeByID(Record[i])) {
|
||||
if (!FunctionType::isValidArgumentType(T))
|
||||
return Error("Invalid function argument type");
|
||||
ArgTys.push_back(T);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user