Skip to content

Commit 6779a95

Browse files
authored
Merge pull request #1442 from vedantk/eng/PR-65276251-5.3
Add missing validity-check for SwiftASTContextReader
2 parents ed17568 + aa88808 commit 6779a95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,9 @@ llvm::Optional<uint64_t> SwiftLanguageRuntimeImpl::GetMemberVariableOffset(
634634

635635
llvm::Optional<SwiftASTContextReader> scratch_ctx;
636636
if (instance) {
637-
scratch_ctx = instance->GetScratchSwiftASTContext();
638-
if (!scratch_ctx)
637+
if (SwiftASTContextReader reader = instance->GetScratchSwiftASTContext())
638+
scratch_ctx = reader;
639+
else
639640
return llvm::None;
640641
}
641642

0 commit comments

Comments
 (0)