-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Priority:3Work that is nice to haveWork that is nice to havearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbugin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Small example:
using InlineIL;
using System;
using System.Runtime.CompilerServices;
public class Program
{
public static void Main()
{
Foo(new C("A"));
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static void Foo(C arg)
{
IL.Emit.Ldarga(nameof(arg));
IL.Emit.Ldarga(nameof(arg));
IL.Emit.Call(new MethodRef(typeof(Program), nameof(Bar)));
IL.Emit.Constrained<C>();
IL.Emit.Callvirt(new MethodRef(typeof(C), nameof(arg.Baz)));
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static int Bar(ref C o)
{
o = new C("B");
return 0;
}
}
public record class C(string Name)
{
public void Baz(int arg)
{
Console.WriteLine(Name);
}
}Expected: B
Actual: A
Seen in #73606 (comment)
category:correctness
theme:importer
skill-level:intermediate
cost:small
impact:small
Metadata
Metadata
Assignees
Labels
Priority:3Work that is nice to haveWork that is nice to havearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbugin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged