diff options
| -rw-r--r-- | clang/include/clang/Lex/Preprocessor.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h index 439a28041e2..f02364a385e 100644 --- a/clang/include/clang/Lex/Preprocessor.h +++ b/clang/include/clang/Lex/Preprocessor.h @@ -454,7 +454,9 @@ class Preprocessor : public RefCountedBase<Preprocessor> { MacroDirective::DefInfo findDirectiveAtLoc(SourceLocation Loc, SourceManager &SourceMgr) const { // FIXME: Incorporate module macros into the result of this. - return getLatest()->findDirectiveAtLoc(Loc, SourceMgr); + if (auto *Latest = getLatest()) + return Latest->findDirectiveAtLoc(Loc, SourceMgr); + return MacroDirective::DefInfo(); } void overrideActiveModuleMacros(Preprocessor &PP, IdentifierInfo *II) { |

