Skip to content

avm: Fix issues with parsing "inf" floats on nightly Rust #3984

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

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

Herschel
Copy link
Member

@Herschel Herschel commented Apr 13, 2021

Rust nightly 4/13 allows f64::parse to handle "infinity", case
insensitive. This broke cases such as Number("Infinity"), which
should return NaN in AVM1. Also, Number("inf") incorrectly
returned Infinity in both AVM1 and AVM2.

Additionally, Rust will now print "-0" for negative zero, when
previously it would print "0".

  • Return NaN for inf cases ("inf", "-Infinity", "+INF", etc.)
  • Add a test for Number("inf") (this was also incorrect before
    the latest nightly)
  • Add a special case for zero in f64_to_string to ensure
    that -0.0 gets coerced to "0".

For more info, see:
rust-lang/rfcs#1074

@Herschel Herschel force-pushed the nightly-num-parse branch from 7472e9a to 0f9fefa Compare April 13, 2021 10:22
Rust nightly 4/13 allows f64::parse to handle "infinity", case
insensitive. This broke cases such as `Number("Infinity")`, which
should return `NaN` in AVM1.

Additionally, Rust will now print "-0" for negative zero, when
previously it would print "0".

 * Return NaN for inf cases ("inf", "-Infinity", "+INF", etc.)
 * Add a test for `Number("inf")` (this was also incorrect before
   the latest nightly)
 * Add a special case for zero in `f64_to_string` to ensure
   that -0.0 gets coerced to "0".

For more info, see:
rust-lang/rfcs#1074
@Herschel Herschel force-pushed the nightly-num-parse branch from 0f9fefa to 800bb58 Compare April 15, 2021 04:25
@Herschel Herschel changed the title avm1: Fix issues with parsing "inf" floats on nightly Rust avm: Fix issues with parsing "inf" floats on nightly Rust Apr 15, 2021
@Herschel Herschel merged commit d87be39 into ruffle-rs:master Apr 15, 2021
@Herschel Herschel deleted the nightly-num-parse branch April 15, 2021 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant