[Bitcode] Check minimum size of constant GEP record
Checking this early, because we may end up reading up to two records before the operands.
This commit is contained in:
@@ -2676,6 +2676,8 @@ Error BitcodeReader::parseConstants() {
|
||||
case bitc::CST_CODE_CE_GEP: // [ty, n x operands]
|
||||
case bitc::CST_CODE_CE_GEP_WITH_INRANGE_INDEX: { // [ty, flags, n x
|
||||
// operands]
|
||||
if (Record.size() < 2)
|
||||
return error("Constant GEP record must have at least two elements");
|
||||
unsigned OpNum = 0;
|
||||
Type *PointeeType = nullptr;
|
||||
if (BitCode == bitc::CST_CODE_CE_GEP_WITH_INRANGE_INDEX ||
|
||||
|
||||
Reference in New Issue
Block a user