Skip to content

Fix JIT this pointer null check elision - #133737

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:fix/133713
Sep 13, 2026
Merged

AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:fix/133713

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Summary

  • Initialize inline argument temp mappings with BAD_VAR_NUM before analyzing this pointer dereferences.
  • Prevent an unfetched this pointer from being confused with caller local V00, preserving the required null check.
  • Add a regression test under Regression_o_3.

Fixes #133713

Note

This pull request description was generated with GitHub Copilot.

Initialize inline argument temp mappings before analyzing this pointer
dereferences, preventing an unfetched this pointer from being confused with
caller local V00.

Fixes dotnet#133713

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78bf0f85-c8ef-4397-a76d-631f5a203e55
Copilot AI lite review requested due to automatic review settings September 11, 2026 20:18
@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 11, 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.

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 review issues remain.

Pull request overview

Fixes JIT this pointer null-check elision and adds regression coverage.

Changes:

  • Initialize inline argument mappings with BAD_VAR_NUM.
  • Add optimized regression coverage for null receivers.
File summaries
File Description
src/tests/JIT/Regression_o_3/Runtime_133713.cs Verifies the required receiver null check.
src/coreclr/jit/importer.cpp Prevents unfetched this from matching caller local V00.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@AndyAyersMS
AndyAyersMS requested a review from EgorBo September 11, 2026 21:06
@AndyAyersMS

Copy link
Copy Markdown
Member Author

@EgorBo PTAL
fyi @dotnet/jit-contrib

Not sure about diffs yet, we took a GUID bump.

Comment thread src/coreclr/jit/importer.cpp
@AndyAyersMS

Copy link
Copy Markdown
Member Author

/ba-g known mono test errors

@AndyAyersMS
AndyAyersMS merged commit 3c4631e into dotnet:main Sep 13, 2026
141 of 144 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 14, 2026
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
## Summary

- Initialize inline argument temp mappings with `BAD_VAR_NUM` before
analyzing this pointer dereferences.
- Prevent an unfetched this pointer from being confused with caller
local `V00`, preserving the required null check.
- Add a regression test under `Regression_o_3`.

Fixes dotnet#133713

> [!NOTE]
> This pull request description was generated with GitHub Copilot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78bf0f85-c8ef-4397-a76d-631f5a203e55
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) inlining an instance method that never uses this drops the receiver null check

3 participants