Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Update IL offsets in fgExpandStaticInitForCall #99662

Merged
merged 4 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/coreclr/jit/helperexpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,17 @@ bool Compiler::fgExpandStaticInitForCall(BasicBlock** pBlock, Statement* stmt, G

// Clear gtInitClsHnd as a mark that we've already visited this call
call->gtInitClsHnd = NO_CLASS_HANDLE;

// Update the IL offsets of the blocks to match the split.

// prevBb->bbCodeOffs remains the same
block->bbCodeOffsEnd = prevBb->bbCodeOffsEnd;

IL_OFFSET splitPointILOffset = fgFindBlockILOffset(block);

prevBb->bbCodeOffsEnd = max(prevBb->bbCodeOffs, splitPointILOffset);
block->bbCodeOffs = min(splitPointILOffset, block->bbCodeOffsEnd);

return true;
}

Expand Down