Skip to content
Prev Previous commit
Next Next commit
Fix loop over buffers.
  • Loading branch information
AaronRobinsonMSFT committed Feb 13, 2022
commit 9615682136317f3f86a179cf57b49c6e1f242170
4 changes: 2 additions & 2 deletions src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8578,9 +8578,9 @@ MethodTableBuilder::HandleExplicitLayout(
// Look for any orefs or byrefs under this field
BYTE *loc = NULL;
BYTE* currOffset = pFieldLayout + pFD->GetOffset_NoLogging();
for (UINT j = 0; j < fieldSize; ++j)
BYTE* endOffset = currOffset + fieldSize;
for (; currOffset < endOffset; ++currOffset)
{
currOffset += j;
if (*currOffset == oref || *currOffset == byref)
{
loc = currOffset;
Expand Down