mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Make sure Op->getType() is a PointerType before we cast<> it.
Bug found with AFL fuzz. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236193 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -4065,6 +4065,8 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
Type *Ty = nullptr;
|
||||
if (OpNum + 3 == Record.size())
|
||||
Ty = getTypeByID(Record[OpNum++]);
|
||||
if (!isa<PointerType>(Op->getType()))
|
||||
return Error("Load operand is not a pointer type");
|
||||
if (!Ty)
|
||||
Ty = cast<PointerType>(Op->getType())->getElementType();
|
||||
else if (Ty != cast<PointerType>(Op->getType())->getElementType())
|
||||
|
Reference in New Issue
Block a user