Skip to content

Commit 5f17b63

Browse files
authored
Merge pull request #2622 from Teemperor/InvertDynamicValueTypeInfoNeedsUpdate
[lldb][swift] Fix inverted cache check in DynamicValueTypeInfoNeedsUpdate
2 parents 4afdf8a + a0b3322 commit 5f17b63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lldb/source/Core/ValueObjectDynamicValue.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@ bool ValueObjectDynamicValue::DynamicValueTypeInfoNeedsUpdate() {
443443
auto *cached_ctx = m_value.GetCompilerType().GetTypeSystem();
444444
llvm::Optional<SwiftASTContextReader> scratch_ctx =
445445
GetScratchSwiftASTContext();
446-
return scratch_ctx ? (cached_ctx == scratch_ctx->get()) : !cached_ctx;
446+
447+
if (!scratch_ctx || !cached_ctx)
448+
return true;
449+
return cached_ctx != scratch_ctx->get();
447450
#else // !LLDB_ENABLE_SWIFT
448451
return false;
449452
#endif // LLDB_ENABLE_SWIFT

0 commit comments

Comments
 (0)