Skip to content

Commit d3d2462

Browse files
author
git apple-llvm automerger
committed
Merge commit '41d6b9bee9be' from swift/release/6.2 into stable/20240723
2 parents ff15aa8 + 41d6b9b commit d3d2462

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -3309,6 +3309,12 @@ SwiftLanguageRuntime::GetSwiftRuntimeTypeInfo(
33093309

33103310
// Resolve all type aliases.
33113311
type = type.GetCanonicalType();
3312+
if (!type) {
3313+
// FIXME: We could print a better error message if
3314+
// GetCanonicalType() returned an Expected.
3315+
return llvm::createStringError(
3316+
"could not get canonical type (possibly due to unresolved typealias)");
3317+
}
33123318

33133319
// Resolve all generic type parameters in the type for the current
33143320
// frame. Generic parameter binding has to happen in the scratch

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,11 @@ TypeSystemSwiftTypeRef::GetCanonicalType(opaque_compiler_type_t type) {
33833383
// then we don't have debug info to resolve it from.
33843384
CompilerType ast_type =
33853385
ReconstructType({weak_from_this(), type}, nullptr).GetCanonicalType();
3386-
return GetTypeFromMangledTypename(ast_type.GetMangledTypeName());
3386+
CompilerType result =
3387+
GetTypeFromMangledTypename(ast_type.GetMangledTypeName());
3388+
if (result && !llvm::isa<TypeSystemSwiftTypeRefForExpressions>(this))
3389+
DiagnoseSwiftASTContextFallback(__FUNCTION__, type);
3390+
return result;
33873391
}
33883392
auto flavor = SwiftLanguageRuntime::GetManglingFlavor(AsMangledName(type));
33893393
auto mangling = mangleNode(canonical, flavor);

0 commit comments

Comments
 (0)