mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-28 20:41:16 +00:00
Make sure Op->getType() is a PointerType before we cast<> it.
Bug found with AFL fuzz. llvm-svn: 236193
This commit is contained in:
1 parent
4b828d35fd
commit
9a19e56306
3 files changed
+7
No files matched your search
@@ -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