Skip to content

Commit 96dcafb

Browse files
committed
[LLDB] Add missing error checking
rdar://157001686
1 parent 96c7323 commit 96dcafb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6716,12 +6716,14 @@ SwiftASTContext::GetBitSize(opaque_compiler_type_t type,
67166716
exe_scope->CalculateExecutionContext(exe_ctx);
67176717
CompilerType bound_type =
67186718
BindGenericTypeParameters({weak_from_this(), type}, exe_scope);
6719+
if (!bound_type)
6720+
return llvm::createStringError("Cannot bind type.");
67196721

67206722
// Check that the type has been bound successfully -- and if not,
67216723
// log the event and bail out to avoid an infinite loop.
67226724
swift::CanType swift_bound_type(GetCanonicalSwiftType(bound_type));
67236725
if (!swift_bound_type || swift_bound_type->hasTypeParameter())
6724-
return llvm::createStringError("Cannot bind type: %s",
6726+
return llvm::createStringError("Cannot canonicalize: %s",
67256727
bound_type.GetTypeName().AsCString(""));
67266728

67276729
// Note that the bound type may be in a different AST context.

0 commit comments

Comments
 (0)