Skip to content

Commit

Permalink
Ensure GetPESectionBlock uses its cache (#90369)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstj authored Aug 11, 2023
1 parent d339063 commit e8c46c2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ private AbstractMemoryBlock GetPESectionBlock(int index)
Interlocked.CompareExchange(ref _lazyPESectionBlocks, new AbstractMemoryBlock[PEHeaders.SectionHeaders.Length], null);
}

AbstractMemoryBlock? existingBlock = Volatile.Read(ref _lazyPESectionBlocks[index]);
if (existingBlock != null)
{
return existingBlock;
}

AbstractMemoryBlock newBlock;
if (IsLoadedImage)
{
Expand Down

0 comments on commit e8c46c2

Please sign in to comment.