[Bitcode] Don't assert on invalid attribute group record
Report an error instead.
This commit is contained in:
@@ -1647,9 +1647,7 @@ Error BitcodeReader::parseAttributeGroupBlock() {
|
||||
}
|
||||
|
||||
B.addAttribute(KindStr.str(), ValStr.str());
|
||||
} else {
|
||||
assert((Record[i] == 5 || Record[i] == 6) &&
|
||||
"Invalid attribute group entry");
|
||||
} else if (Record[i] == 5 || Record[i] == 6) {
|
||||
bool HasType = Record[i] == 6;
|
||||
Attribute::AttrKind Kind;
|
||||
if (Error Err = parseAttrKind(Record[++i], &Kind))
|
||||
@@ -1658,6 +1656,8 @@ Error BitcodeReader::parseAttributeGroupBlock() {
|
||||
return error("Not a type attribute");
|
||||
|
||||
B.addTypeAttr(Kind, HasType ? getTypeByID(Record[++i]) : nullptr);
|
||||
} else {
|
||||
return error("Invalid attribute group entry");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user