mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236190 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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