In some cases, ilcompiler uses the eax register instead of the al register for the return value in the assembly code generated for the il code calli bool ().
Reproduction Steps
Clone this repo and run publish_and_run.cmd, the output should be
ILCompiler8
FalseBranch but bar is False
ILCompiler9
TrueBranch but bar is False
Expected behavior
// c#
var bar = ((delegate*<nint, bool>) foo)(114514);
if (bar) { /* do something */ }
Description
In some cases, ilcompiler uses the
eax
register instead of theal
register for the return value in the assembly code generated for the il codecalli bool ()
.Reproduction Steps
Clone this repo and run
publish_and_run.cmd
, the output should beExpected behavior
Actual behavior
c#: same as above
msil: same as above
Regression?
works fine in 8.0.11, errors in 9.0.0-preview.1.24080.9
Known Workarounds
No response
Configuration
.NET Version: 9.0.100 OS: Windows 10.0.19045 Architecture: x64
Other information
No response