Fix off-by-one error in an assert condition. No functionality change, but better
error detection. llvm-svn: 146962
This commit is contained in:
parent
0f8ede1654
commit
ce3ad9a357
|
@ -4564,7 +4564,7 @@ Decl *ASTReader::GetDecl(DeclID ID) {
|
|||
|
||||
unsigned Index = ID - NUM_PREDEF_DECL_IDS;
|
||||
|
||||
if (Index > DeclsLoaded.size()) {
|
||||
if (Index >= DeclsLoaded.size()) {
|
||||
Error("declaration ID out-of-range for AST file");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue