projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61c3d87
)
Add one more sanity check in SourceManager::getFileIDLoaded().
author
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Fri, 1 Mar 2013 03:43:33 +0000
(
03:43
+0000)
committer
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Fri, 1 Mar 2013 03:43:33 +0000
(
03:43
+0000)
llvm-svn: 176333
clang/lib/Basic/SourceManager.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Basic/SourceManager.cpp
b/clang/lib/Basic/SourceManager.cpp
index 8fa648c730b996676c71b1fe6a97d5e7af0176c0..1b8383bc426128546ba83bf986e3c8415f9bfde1 100644
(file)
--- a/
clang/lib/Basic/SourceManager.cpp
+++ b/
clang/lib/Basic/SourceManager.cpp
@@
-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;
}
}