NativeAOT: Usage of static virtual
method from interface gets miscompiled as infinite loop
#110932
Labels
static virtual
method from interface gets miscompiled as infinite loop
#110932
Description
In .NET9 NativeAOT, usage of a
static virtual
method from an interface sometimes gets miscompiled to an infinte loop.Reproduction Steps
Or on gotbolt: https://godbolt.org/z/7P1rsMs4x
Expected behavior
Actual behavior
Regression?
Yes, the same code does not hang on .NET 8 NativeAOT.
Known Workarounds
static abstract
instead ofstatic virtual
.[MethodImpl(MethodImplOptions.NoInlining)]
to the abstract method.Configuration
.NET 9.0.100
Windows 10 x64
Other information
Using a larger method body still triggers the issue (the normal body runs before entering the infinite loop).
Implementing the interface on a
class
instead of astruct
still triggers the issue.The text was updated successfully, but these errors were encountered: