mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 10:01:42 +00:00
Add one more sanity check in SourceManager::getFileIDLoaded().
llvm-svn: 176333
This commit is contained in:
parent
61c3d8778c
commit
1ca7344506
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user