Make sure we don't resize(0) when we get a fwdref with Idx == UINT_MAX
Make it an error instead. Bug found with AFL fuzz. llvm-svn: 236190
This commit is contained in:
1 parent
34948e5e22
commit
bad0779f63
3 files changed
+9
No files matched your search
@@ -790,6 +790,10 @@ Constant *BitcodeReaderValueList::getConstantFwdRef(unsigned Idx,
|
||||
}
|
||||
|
||||
Value *BitcodeReaderValueList::getValueFwdRef(unsigned Idx, Type *Ty) {
|
||||
// Bail out for a clearly invalid value. This would make us call resize(0)
|
||||
if (Idx == UINT_MAX)
|
||||
return nullptr;
|
||||
|
||||
if (Idx >= size())
|
||||
resize(Idx + 1);
|
||||
|
||||
|
||||
Reference in new issue
Block a user