Skip to content

JIT: Fix block-store address containment boundary - #133803

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:fix-jit-block-address-boundary-133785
Sep 18, 2026
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:fix-jit-block-address-boundary-133785

Conversation

@EgorBo

@EgorBo EgorBo commented Sep 12, 2026

Copy link
Copy Markdown
Member

Fixes #133785

Align block-store containment bounds with codegen assertions on xarch and ARM64; add regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dc2793e8-3f85-4610-9afb-2b990ed92316
Copilot AI lite review requested due to automatic review settings September 12, 2026 21:23
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 12, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

Pull request overview

Fixes a JIT block-store containment boundary mismatch that could trigger checked-build assertions.

Changes:

  • Tightens xarch and ARM64 containment bounds.
  • Adds regression coverage for initialization, copy, and load paths.
File summaries
File Description
src/tests/JIT/Regression_ro_2/Runtime_133785.cs Adds boundary block-store regression tests.
src/coreclr/jit/lowerxarch.cpp Rejects the unsupported boundary displacement.
src/coreclr/jit/lowerarmarch.cpp Applies equivalent ARM64 boundary handling.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

@EgorBo

EgorBo commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

PTAL @dhartglassMSFT

public class Runtime_133785
{
// On x64, the element offset is 16 + Index * 3 == int.MaxValue - 3.
private const int Index = 715827876;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting this to 715827875 instead still hits an assert in codegenarmarch due to some overflowing signed int math in UnrollInitBlock. Bug existed before your change though so up to you if its easy enough to fix while youre in here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, interesting, I'll check

@EgorBo

EgorBo commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

/ba-g unstable mono

@EgorBo
EgorBo enabled auto-merge (squash) September 18, 2026 22:51
@EgorBo
EgorBo merged commit d542568 into dotnet:main Sep 18, 2026
142 of 145 checks passed
@EgorBo
EgorBo deleted the fix-jit-block-address-boundary-133785 branch September 18, 2026 22:51
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: (bug) x64: assert dstOffset < (INT32_MAX - size) in genCodeForInitBlkUnroll/genCodeForCpBlkUnroll for a boundary address-mode displacement

3 participants