From 96dcafbae422d5ab99f6d73abac7c154b4c908a2 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 14 Nov 2025 17:37:50 -0800 Subject: [PATCH] [LLDB] Add missing error checking rdar://157001686 --- lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index 76b74b78821b8..ee4d1483eeb81 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -6716,12 +6716,14 @@ SwiftASTContext::GetBitSize(opaque_compiler_type_t type, exe_scope->CalculateExecutionContext(exe_ctx); CompilerType bound_type = BindGenericTypeParameters({weak_from_this(), type}, exe_scope); + if (!bound_type) + return llvm::createStringError("Cannot bind type."); // Check that the type has been bound successfully -- and if not, // log the event and bail out to avoid an infinite loop. swift::CanType swift_bound_type(GetCanonicalSwiftType(bound_type)); if (!swift_bound_type || swift_bound_type->hasTypeParameter()) - return llvm::createStringError("Cannot bind type: %s", + return llvm::createStringError("Cannot canonicalize: %s", bound_type.GetTypeName().AsCString("")); // Note that the bound type may be in a different AST context.