mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 04:41:30 +00:00
Check that we have a valid PointerType element type before calling get()
Same as r236073 but for PointerType. Bug found with AFL fuzz. llvm-svn: 236079
This commit is contained in:
1 parent
52d42c725a
commit
d8a1bcd0ad
3 files changed
+4
-1
No files matched your search
@@ -1360,7 +1360,8 @@ std::error_code BitcodeReader::ParseTypeTableBody() {
|
||||
if (Record.size() == 2)
|
||||
AddressSpace = Record[1];
|
||||
ResultTy = getTypeByID(Record[0]);
|
||||
if (!ResultTy)
|
||||
if (!ResultTy ||
|
||||
!PointerType::isValidElementType(ResultTy))
|
||||
return Error("Invalid type");
|
||||
ResultTy = PointerType::get(ResultTy, AddressSpace);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user