Skip to content

Commit 490cf64

Browse files
Merge pull request #74214 from augusto2112/null-decl-context-6.0
Check if decl context returned by importDeclContextOf is null
2 parents 653f07c + f5bd65a commit 490cf64

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3428,7 +3428,9 @@ ImportedType ClangImporter::Implementation::importAccessorParamsAndReturnType(
34283428
// FIXME: Duplicated from importMethodParamsAndReturnType.
34293429
DeclContext *origDC = importDeclContextOf(property,
34303430
property->getDeclContext());
3431-
assert(origDC);
3431+
if (!origDC)
3432+
return {Type(), false};
3433+
34323434
auto fieldType = isGetter ? clangDecl->getReturnType()
34333435
: clangDecl->getParamDecl(0)->getType();
34343436

0 commit comments

Comments
 (0)