Fix assertion when input is an empty string.

llvm-svn: 64397
This commit is contained in:
Daniel Dunbar 2009-02-12 19:31:53 +00:00
parent 41e3fc1ff5
commit ad027c7781
1 changed files with 1 additions and 1 deletions

View File

@ -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?