diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-19 06:12:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-19 06:12:06 +0000 |
commit | 5de65721bd31e57f883634d9f10b1bff75c4ffc2 (patch) | |
tree | f20e6e06adf0dd523bee9ff57db048f49a2ee7fe /lib/Basic/SourceManager.cpp | |
parent | 0396f466978d65789eca85b2738e9df53adc78f5 (diff) |
Fix a longstanding (but previously unknown) bug in the lazy
deserialization of precompiled headers, where the deserialization of
the source location entry for a buffer (e.g., macro instantiation
scratch space) would overwrite a one-element FileID cache in the
source manager. When tickled at the wrong time, we would return the
wrong decomposed source location and eventually cause c-index-test to
crash.
Found by dumb luck. It's amazing this hasn't shown up before.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r-- | lib/Basic/SourceManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 4c24d030b8..6def967c4c 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -411,7 +411,7 @@ FileID SourceManager::createFileID(const ContentCache *File, = SLocEntry::get(Offset, FileInfo::get(IncludePos, File, FileCharacter)); SLocEntryLoaded[PreallocatedID] = true; FileID FID = FileID::get(PreallocatedID); - return LastFileIDLookup = FID; + return FID; } SLocEntryTable.push_back(SLocEntry::get(NextOffset, |