[lldb] Make sure there's a value for the key before dereferencing.

Make sure there's a value for the shared_cache_base_address key exists
in the dictionary before trying to dereference the value.

rdar://76894476
This commit is contained in:
Jonas Devlieghere 2021-09-08 13:44:24 -07:00
parent f4726e7238
commit d1d4f36556
1 changed files with 6 additions and 2 deletions

View File

@ -2188,8 +2188,12 @@ lldb::addr_t AppleObjCRuntimeV2::GetSharedCacheBaseAddress() {
if (!info_dict)
return LLDB_INVALID_ADDRESS;
return info_dict->GetValueForKey("shared_cache_base_address")
->GetIntegerValue(LLDB_INVALID_ADDRESS);
StructuredData::ObjectSP value =
info_dict->GetValueForKey("shared_cache_base_address");
if (!value)
return LLDB_INVALID_ADDRESS;
return value->GetIntegerValue(LLDB_INVALID_ADDRESS);
}
void AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded() {