diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-23 02:16:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-23 02:16:44 +0000 |
commit | 9d5a165d301cc9df68631e624322dd2a962f65b3 (patch) | |
tree | a9e0dc6d2b632a94a942afdb970780a6fa6997b1 /include/clang/Basic/SourceManager.h | |
parent | 114d63955f8d55e4c2f0350abf907fbb5eeeb08b (diff) |
Fix crash in clang_getInstantiationLoc() when SourceManager::getInstantiationLoc() can return a SourceLocatin with an invalid
FileID on invalid code. Fixes <rdar://problem/9164623>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 4c8a805538..260092536e 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -585,6 +585,12 @@ public: return getSLocEntry(FID).getFile().getContentCache()->OrigEntry; } + /// Returns the FileEntry record for the provided SLocEntry. + const FileEntry *getFileEntryForSLocEntry(const SrcMgr::SLocEntry &sloc) const + { + return sloc.getFile().getContentCache()->OrigEntry; + } + /// getBufferData - Return a StringRef to the source buffer data for the /// specified FileID. /// |