JIT: Guard comma throw propagation types - #134387
Conversation
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
|
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. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
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. |
|
@EgorBo PTAL |
adamperlin
left a comment
There was a problem hiding this comment.
This looks reasonable to me!
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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
Mark the replacement zero node as morphed before returning the propagated comma. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.