mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
[BitcodeReader] Error out if we read an invalid function argument type
Bug found with AFL fuzz. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237650 91177308-0d34-0410-b5e6-96231b3b80d8
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