We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#64234 appears to surface a bug in Mono where it incorrectly handles double->nint but not float->nint conversions.
double->nint
float->nint
The test is in the form:
[Theory] [InlineData(-4567.0f)] public void NFloatToIntPtr(float value) { nint result = (nint)new NFloat(value); Assert.Equal((nint)value, result); }
Where NFloat is roughly defined as:
public readonly struct NFloat { private readonly double _value; public NFloat(double value) { _value = value; } public static explicit operator nint(NFloat value) => (nint)(value._value); }
This resulted in https://dev.azure.com/dnceng/public/_build/results?buildId=1574581&view=ms.vss-test-web.build-test-results-tab&runId=44208602&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab&resultId=164309
Where the exact failure is:
System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567) [FAIL] Assert.Equal() Failure Expected: -4567 Actual: 4294962729 Stack Trace: /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs(483,0): at System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(Single value) /_/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs(386,0): at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters) System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567.89111) [FAIL] Assert.Equal() Failure Expected: -4567 Actual: 4294962729 Stack Trace: /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs(483,0): at System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(Single value) /_/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs(386,0): at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
The text was updated successfully, but these errors were encountered:
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Sorry, something went wrong.
[mono] Fix r8->i conversion on amd64/arm64.
3225deb
Fixes dotnet#64386.
[mono] Fix r8->i conversion on amd64/arm64. (#64467)
8471eec
Fixes #64386.
d496323
[mono] Fix r8->i conversion on amd64/arm64. (#65329)
d774991
Fixes #64386. Co-authored-by: Zoltan Varga <vargaz@gmail.com>
vargaz
Successfully merging a pull request may close this issue.
#64234 appears to surface a bug in Mono where it incorrectly handles
double->nint
but notfloat->nint
conversions.The test is in the form:
Where NFloat is roughly defined as:
This resulted in https://dev.azure.com/dnceng/public/_build/results?buildId=1574581&view=ms.vss-test-web.build-test-results-tab&runId=44208602&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab&resultId=164309
Where the exact failure is:
The text was updated successfully, but these errors were encountered: