summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-12 19:31:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-12 19:31:53 +0000
commitad027c7781ebefa8971aa3ebffc78927410fdebe (patch)
treee1f3ff3460472fc5c15f755d04cf37d8f8586fe9 /clang/lib/Lex/PTHLexer.cpp
parent41e3fc1ff5225cdccf0ab51b4740aa83004e2abd (diff)
downloadbcm5719-llvm-ad027c7781ebefa8971aa3ebffc78927410fdebe.tar.gz
bcm5719-llvm-ad027c7781ebefa8971aa3ebffc78927410fdebe.zip
Fix assertion when input is an empty string.
llvm-svn: 64397
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r--clang/lib/Lex/PTHLexer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp
index 4648ac8ee49..0cd17e74a4b 100644
--- a/clang/lib/Lex/PTHLexer.cpp
+++ b/clang/lib/Lex/PTHLexer.cpp
@@ -721,7 +721,7 @@ IdentifierInfo* PTHManager::LazilyCreateIdentifierInfo(unsigned PersistentID) {
IdentifierInfo* PTHManager::get(const char *NameStart, const char *NameEnd) {
PTHStringIdLookup& SL = *((PTHStringIdLookup*)StringIdLookup);
// Double check our assumption that the last character isn't '\0'.
- assert(NameStart[NameEnd-NameStart-1] != '\0');
+ assert(NameEnd==NameStart || NameStart[NameEnd-NameStart-1] != '\0');
PTHStringIdLookup::iterator I = SL.find(std::make_pair(NameStart,
NameEnd - NameStart));
if (I == SL.end()) // No identifier found?
OpenPOWER on IntegriCloud