Skip to content

Commit 3d73ec6

Browse files
WeiN76LQh0cyn
authored andcommitted
[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.
1 parent b577685 commit 3d73ec6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

view/sharedcache/core/SharedCache.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,13 +2424,13 @@ void SharedCache::InitializeHeader(
24242424

24252425
for (size_t i = 0; i < header.sections.size(); i++)
24262426
{
2427-
bool skip = false;
2427+
bool skip = true;
24282428
for (const auto& region : regionsToLoad)
24292429
{
24302430
if (header.sections[i].addr >= region->start && header.sections[i].addr < region->start + region->size)
24312431
{
2432-
if (MemoryRegionIsHeaderInitialized(lock, *region))
2433-
skip = true;
2432+
if (!MemoryRegionIsHeaderInitialized(lock, *region))
2433+
skip = false;
24342434
break;
24352435
}
24362436
}

0 commit comments

Comments
 (0)