summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCache.cpp
diff options
context:
space:
mode:
authorWeiN76LQh <WeiN76LQh@github.com>2025-02-27 01:03:07 +0000
committerkat <kat@vector35.com>2025-03-18 06:15:41 -0400
commit3d73ec6994319e90ac08d2d5757ae6598c09373a (patch)
tree14c816dbdab72973d96808c1b2bab42c09eb91d0 /view/sharedcache/core/SharedCache.cpp
parentb5776854ff0cb2074d7df39047aca15076e80bcc (diff)
[SharedCache] Limit sections being added in `SharedCache::InitializeHeader` to the regions being loaded
The logic before would default to adding a section unless it was from a region in the `regionsToLoad` argument and its header had already been initialized. However if a user does `Load Section by Address` then there's only one region in `regionsToLoad`. All sections not in that region would be automatically added, even if they had already been or the user hadn't requested them to be loaded.
Diffstat (limited to 'view/sharedcache/core/SharedCache.cpp')
-rw-r--r--view/sharedcache/core/SharedCache.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp
index e3c115cd..9e578384 100644
--- a/view/sharedcache/core/SharedCache.cpp
+++ b/view/sharedcache/core/SharedCache.cpp
@@ -2424,13 +2424,13 @@ void SharedCache::InitializeHeader(
for (size_t i = 0; i < header.sections.size(); i++)
{
- bool skip = false;
+ bool skip = true;
for (const auto& region : regionsToLoad)
{
if (header.sections[i].addr >= region->start && header.sections[i].addr < region->start + region->size)
{
- if (MemoryRegionIsHeaderInitialized(lock, *region))
- skip = true;
+ if (!MemoryRegionIsHeaderInitialized(lock, *region))
+ skip = false;
break;
}
}