-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
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
Switch expression in C# 8 behaves differently on x86 vs x64 android #68906
Comments
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. |
/cc @SamMonoRT |
@lambdageek - please correct me if I'm wrong. This is low priority for us to fix any x86 issues. Majority of devices are x64 or arm64 based. Does it make sense to fix these or can we disable the relevant tests on android x86 libraries lane ? |
This looks like a codegen bug so who knows where else it might show up, I don't think this is low priority. |
I agree with Alexander, we need to do some investigation before we can judge if this is low impact. |
I will start the investigation early next week. |
I tried to reproduce today and wasn't able to reproduce the wrong behavior on Android x86. This is what I get
I am closing this issue. If it is reproducible again, please feel free to re-open it. |
I verified this doesn't happen in main anymore, it was fixed by #65723 since I can repro if I revert that change (you need to build in Release config to see it). |
Description
Switch expression in C# 8 behaves differently on x86 vs x64 Android. After third call it behaves differently for float type.
Reproduction Steps
Copy paste the below code in mono/samples/Android and try to run on x86 android emulator.
GetNumberAsString after third call starts returning NAN, even if it is called for the same value (float.MaxValue).
Expected behavior
GetNumberAsString should convert correctly after third call also.
To get expected behaviour please uncomment first switch in GetNumberAsString and comment last one.
TypeCode enum switch works correct on both x64 and x86, so my guess is switch expression in C# 8 behaves differently on x86 vs x64 Android.
Actual behavior
First 3 times GetNumberAsString returns correct value. After that it starts to return NAN.
Regression?
No response
Known Workarounds
Using TypeCode enum switch works fine on both x64 and x86.
Configuration
Try on Android x86.
Other information
When I comment other cases in switch seems it works.
The text was updated successfully, but these errors were encountered: