From 927d154d60380e281f1deced119b9c0978ceae47 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 22 Sep 2025 11:11:32 -0700 Subject: [PATCH] [lldb] Fix nullptr check condition rdar://160890031 (cherry picked from commit 62a1df762ab83616052c9b1b76707967ddbe06d4) --- lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index 0f3bd95b6b157..4d02bdfcdd8d2 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -6603,7 +6603,7 @@ SwiftASTContext::GetBitSize(opaque_compiler_type_t 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()) + if (!swift_bound_type || swift_bound_type->hasTypeParameter()) return llvm::createStringError("Cannot bind type: %s", bound_type.GetTypeName().AsCString(""));