Skip to content

Commit c2767f1

Browse files
authored
Merge pull request #17984 from rudkx/rdar41888568
Guard for null result from ClangModuleUnit::getClangModule().
2 parents 6190bb8 + f94d653 commit c2767f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -3610,7 +3610,7 @@ bool ClangImporter::isInOverlayModuleForImportedModule(
36103610
importedDC = importedDC->getModuleScopeContext();
36113611

36123612
auto importedClangModuleUnit = dyn_cast<ClangModuleUnit>(importedDC);
3613-
if (!importedClangModuleUnit)
3613+
if (!importedClangModuleUnit || !importedClangModuleUnit->getClangModule())
36143614
return false;
36153615

36163616
auto overlayModule = overlayDC->getParentModule();

0 commit comments

Comments
 (0)