Fix off-by-one error in an assert condition. No functionality change, but better

error detection.

llvm-svn: 146962
This commit is contained in:
Richard Smith 2011-12-20 04:39:57 +00:00
parent 0f8ede1654
commit ce3ad9a357
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}