Add one more sanity check in SourceManager::getFileIDLoaded().

llvm-svn: 176333
This commit is contained in:
Argyrios Kyrtzidis 2013-03-01 03:43:33 +00:00
parent 61c3d8778c
commit 1ca7344506

View File

@ -863,6 +863,11 @@ FileID SourceManager::getFileIDLoaded(unsigned SLocOffset) const {
return Res;
}
// Sanity checking, otherwise a bug may lead to hanging in release build.
if (LessIndex == MiddleIndex) {
assert(0 && "binary search missed the entry");
return FileID();
}
LessIndex = MiddleIndex;
}
}