Skip to content

Unexpected ArgumentException in Tier1 vs Tier0 #133267

Closed

Description

@EgorBo
Test(new object[4], [1, 1, 1, 1]);

[MethodImpl(MethodImplOptions.NoInlining |
    MethodImplOptions.NoOptimization)]
static int Test(object[] key, int[] fields)
{
    int c = key != null ? key.Length : 0;
    if (key is null || c <= 0 || fields.Length != c)
        throw new ArgumentException();

    int sum = 0;
    for (int i = 0; i < key.Length; i++)
        sum += fields[i];
    return sum;

}

Debug: no exception
Release: ArgumentException was thrown.

.NET 11.0, win-x64

Activity

  1. added
    untriaged
    on Sep 4, 2026
  2. added
    area-CodeGen-coreclr
    on Sep 4, 2026
  3. dotnet-policy-service commented on Sep 4, 2026

    @dotnet-policy-service
    Contributor

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

  4. self-assigned this
    on Sep 4, 2026
  5. removed
    untriaged
    on Sep 4, 2026
  6. added this to the 11.0.0 milestone on Sep 4, 2026
  7. added a commit that references this issue on Sep 7, 2026
    b22e1b8
  8. locked and limited conversation to collaborators on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions