Skip to content

JIT: Guard comma throw propagation types - #134387

Merged
AndyAyersMS merged 3 commits into
dotnet:mainfrom
AndyAyersMS:fix-133862-comma-throw-propagation
Sep 25, 2026
Merged

AndyAyersMS merged 3 commits into
dotnet:mainfrom
AndyAyersMS:fix-133862-comma-throw-propagation

Conversation

@AndyAyersMS

@AndyAyersMS AndyAyersMS commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Comma throw propagation could create invalid struct-typed zero constants.
Revise the code; also stop bashing things.

Resolves #133862

Note

This pull request was generated with GitHub Copilot.

Comma throw propagation could create invalid struct-typed zero constants. Centralize
the BashToZeroConst type constraint and skip propagation when a zero constant
cannot represent the parent type.

Fixes dotnet#133862

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d1dcb1f4-83e0-44fa-8060-109bd4fa2957
Copilot AI lite review requested due to automatic review settings September 22, 2026 00:44
@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 22, 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.

Copilot review overview

🔵 Needs a closer look

JIT code-generation changes warrant final human validation despite the focused regression test.

Review effort: Lite
Findings: None

What changed in this PR

This PR guards JIT comma-throw propagation against invalid struct-typed zero constants and adds a regression test.

Changes:

  • Centralizes supported zero-constant type validation.
  • Skips propagation for unsupported parent types.
  • Adds a tiering-disabled FullOpts regression test.
File Description
src/​tests/​JIT/​Regression_2/​Runtime_133862/​Runtime_133862.csproj Configures optimized, non-tiered execution.
src/​tests/​JIT/​Regression_2/​Runtime_133862/​Runtime_133862.cs Adds the regression test.
src/​coreclr/​jit/​morph.cpp Guards comma-throw propagation.
src/​coreclr/​jit/​gentree.h Declares the type-check helper.
src/​coreclr/​jit/​compiler.hpp Implements the supported type constraint.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@EgorBo PTAL
fyi @dotnet/jit-contrib

@AndyAyersMS
AndyAyersMS requested a review from EgorBo September 22, 2026 21:03

@adamperlin adamperlin 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.

This looks reasonable to me!

Comment thread src/tests/JIT/Regression_2/Runtime_133862/Runtime_133862.csproj Outdated
Comment thread src/coreclr/jit/morph.cpp Outdated

@EgorBo EgorBo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

with a few nits

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 24, 2026 23:09

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.

Copilot review overview

🟡 Changes recommended

The replacement node must be marked as morphed, and the regression test must explicitly disable tiered compilation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)

Comment thread src/coreclr/jit/morph.cpp Outdated
Comment thread src/tests/JIT/Regression_2/Runtime_133862/Runtime_133862.csproj Outdated
Mark the replacement zero node as morphed before returning the propagated comma.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 24, 2026 23:46

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.

Copilot review overview

🔵 Needs a closer look

JIT compiler changes require final human review despite the regression test.

Review effort: Lite
Findings: None

Resolved since last review (2)

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 26, 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) Assert varTypeIsIntegral(type) || varTypeIsGC(type) in morph: comma-throw propagated into a struct-typed parent

4 participants