diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-06-07 17:57:59 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-06-07 17:57:59 +0000 |
commit | fe68302fe819b28165a9933ce7ef8f465609da8b (patch) | |
tree | c52a0302350c12bcdf6262777169f3274cde5d35 /clang/lib/Basic/SourceManager.cpp | |
parent | 158d8069ad3cf660dceac4e4e1b150f5cb03289c (diff) | |
download | bcm5719-llvm-fe68302fe819b28165a9933ce7ef8f465609da8b.tar.gz bcm5719-llvm-fe68302fe819b28165a9933ce7ef8f465609da8b.zip |
Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees of SourceManager::getSLocEntryByID().
Also add an 'Invalid' check in SourceManager::computeMacroArgsCache().
llvm-svn: 183538
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 0de5129a358..2e3fb7db412 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -1808,7 +1808,10 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap *&CachePtr, return; } - const SrcMgr::SLocEntry &Entry = getSLocEntryByID(ID); + bool Invalid = false; + const SrcMgr::SLocEntry &Entry = getSLocEntryByID(ID, &Invalid); + if (Invalid) + return; if (Entry.isFile()) { SourceLocation IncludeLoc = Entry.getFile().getIncludeLoc(); if (IncludeLoc.isInvalid()) |