Skip to content

Commit 53b2d86

Browse files
committed
[CSApply] Determine whether to emit runtime isolation check based on Module::isConcurrencyChecked API
1 parent 4e5e6cc commit 53b2d86

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/Sema/CSApply.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7448,9 +7448,11 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
74487448
if (decl->hasClangNode())
74497449
return false;
74507450

7451-
auto *declaredIn = decl->getModuleContext();
7452-
return declaredIn && declaredIn != dc->getParentModule() &&
7453-
!declaredIn->getLanguageVersionBuiltWith().isVersionAtLeast(6);
7451+
auto declaredIn = decl->findImport(dc);
7452+
if (!declaredIn)
7453+
return false;
7454+
7455+
return !declaredIn->module.importedModule->isConcurrencyChecked();
74547456
};
74557457

74567458
if (requiresRuntimeCheck()) {

0 commit comments

Comments
 (0)