Skip to content

Guard stale VN store in unused GetType extraction - #133485

Merged
jakobbotsch merged 1 commit into
mainfrom
copilot/add-vnstore-null-check
Sep 10, 2026
Merged

jakobbotsch merged 1 commit into
mainfrom
copilot/add-vnstore-null-check

Conversation

Copilot AI commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Avoid dereferencing vnStore when value numbering has been discarded while extracting side effects from an unused Object.GetType node.

  • Guard replacement null-check VN assignment with vnStore != nullptr.
  • Preserve the existing VN assignment when a valid store is available.

Copilot AI changed the title Guard value-number store during unused GetType extraction Guard stale VN store in unused GetType extraction Sep 9, 2026
Copilot AI requested a review from jakobbotsch September 9, 2026 11:31
@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.

@jakobbotsch
jakobbotsch marked this pull request as ready for review September 9, 2026 11:34
Copilot AI lite review requested due to automatic review settings September 9, 2026 11:34
@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 9, 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

The change is minimal, matches existing vnStore-guarding patterns nearby, and removes a concrete null-dereference hazard without altering behavior when VN data is available.

Pull request overview

This PR updates a JIT-side side-effect extraction path to avoid dereferencing a stale/null vnStore when converting an unused Object.GetType intrinsic into a NULLCHECK, while still preserving the original node’s exception VN information when value numbering is available.

Changes:

  • Add a vnStore != nullptr guard before re-materializing the replacement node’s gtVNPair via VNPWithExc.
File summaries
File Description
src/coreclr/jit/gentree.cpp Avoids vnStore dereference when value numbering has been discarded during unused GetType → NULLCHECK conversion.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@jakobbotsch
jakobbotsch merged commit a0b86b1 into main Sep 10, 2026
139 of 140 checks passed
@jakobbotsch
jakobbotsch deleted the copilot/add-vnstore-null-check branch September 10, 2026 09:07
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 14, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants