Skip to content

Commit cc22d39

Browse files
Merge pull request #6359 from adrian-prantl/materializer-guard
Guard Swift-specific code against invalid input.
2 parents a876417 + 3c2cd31 commit cc22d39

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lldb/source/Expression/Materializer.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -510,14 +510,15 @@ class EntityVariableBase : public Materializer::Entity {
510510
valobj_sp->GetAddressOf(scalar_is_load_address, &address_type);
511511

512512
// BEGIN Swift.
513-
if (lldb::ProcessSP process_sp =
514-
map.GetBestExecutionContextScope()->CalculateProcess())
515-
if (auto runtime = process_sp->GetLanguageRuntime(
516-
valobj_type.GetMinimumLanguage())) {
517-
Status read_error;
518-
addr_of_valobj =
519-
runtime->FixupAddress(addr_of_valobj, valobj_type, read_error);
520-
}
513+
if (addr_of_valobj != LLDB_INVALID_ADDRESS)
514+
if (lldb::ProcessSP process_sp =
515+
map.GetBestExecutionContextScope()->CalculateProcess())
516+
if (auto runtime = process_sp->GetLanguageRuntime(
517+
valobj_type.GetMinimumLanguage())) {
518+
Status read_error;
519+
addr_of_valobj =
520+
runtime->FixupAddress(addr_of_valobj, valobj_type, read_error);
521+
}
521522
// END Swift.
522523

523524
if (addr_of_valobj != LLDB_INVALID_ADDRESS) {

0 commit comments

Comments
 (0)