-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
area-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 SuperPMIblocking-releasebugregression-from-last-release
Milestone
Description
Description
The following code snippet consequently fails with System.EntryPointNotFoundException
if executed using configuration Release
:
while (true)
{
var values = new[] { DayOfWeek.Saturday }.Cast<int>();
foreach (var value in values)
{
}
}
Reproduction Steps
while (true)
{
var values = new[] { DayOfWeek.Saturday }.Cast<int>();
foreach (var value in values)
{
}
}
save this 👆 into a file and run it using dotnet run --configuration release .
Expected behavior
The code snippet runs forever without an exception.
Actual behavior
After 5000 iterations of the while
loop the following exception is thrown:
Unhandled exception. System.EntryPointNotFoundException: Entry point was not found.
at System.Collections.Generic.IEnumerator`1.get_Current()
at Program.<Main>$(String[] args) in C:\projects\scratch\enum10\Program.cs:line 4
Regression?
It works with TFM net8.0
.
It works with TFM net9.0
.
Known Workarounds
Not using Cast<int>
solves the problem.
Configuration
- .NET 10.0.100-rc.1.25451.107
- OS Windows 11
- x64
- the problem occurs only with configuration
Release
Other information
No response
Metadata
Metadata
Assignees
Labels
area-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 SuperPMIblocking-releasebugregression-from-last-release