Skip to content

Commit 49937a6

Browse files
committed
[clang] don't crash if there is no summary consumer
1 parent 1155844 commit 49937a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,8 @@ void CompilerInstance::createSema(TranslationUnitKind TUKind,
764764
CodeCompleteConsumer *CompletionConsumer,
765765
SummaryConsumer *SummaryConsumer) {
766766
TheSema.reset(new Sema(getPreprocessor(), getASTContext(), getASTConsumer(),
767-
TUKind, CompletionConsumer, &getSummaryContext(),
767+
TUKind, CompletionConsumer,
768+
hasSummaryContext() ? &getSummaryContext() : nullptr,
768769
SummaryConsumer));
769770

770771
// Set up API notes.

0 commit comments

Comments
 (0)