Skip to content

Commit

Permalink
[lldb] Make sure there's a value for the key before dereferencing.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JDevlieghere committed Sep 8, 2021
1 parent f4726e7 commit d1d4f36
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -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() {
Expand Down

0 comments on commit d1d4f36

Please sign in to comment.