diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-12 19:31:53 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-12 19:31:53 +0000 |
commit | 82320e94606cfb0f68c6049c070c3600f8df9081 (patch) | |
tree | 0be40428c070ed8fb9dfb83f5e894b1037f04ada /lib/Lex/PTHLexer.cpp | |
parent | 4fc526d80d829b2f8c294a4c3360c820f1f6e7c2 (diff) |
Fix assertion when input is an empty string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r-- | lib/Lex/PTHLexer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 4648ac8ee4..0cd17e74a4 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/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? |