Skip to content

ConstantFolding: fix wrong constant folding for float-infinity compares #71610

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 1 commit into from
Feb 15, 2024

Conversation

eeckstein
Copy link
Contributor

Only if the other operand of an comparison with Inf is a literal we can be sure that it's not Inf or NaN.

Fixes a miscompile
rdar://122605966

@eeckstein
Copy link
Contributor Author

@swift-ci test

Only if the other operand of a comparison with Inf is a literal we can be sure that it's not Inf or NaN.

Fixes a miscompile
rdar://122605966
@eeckstein
Copy link
Contributor Author

@swift-ci test

@tbkka
Copy link
Contributor

tbkka commented Feb 14, 2024

CC: @jkshtj Looks like #69828 was somewhat over-eager. It caused float + 0 < infinity to always evaluate true, among other problems.

@jkshtj
Copy link
Contributor

jkshtj commented Feb 14, 2024

CC: @jkshtj Looks like #69828 was somewhat over-eager. It caused float + 0 < infinity to always evaluate true, among other problems.

Sorry for the oversight on my part! Thank you for letting me know.

@eeckstein eeckstein merged commit 823db1f into swiftlang:main Feb 15, 2024
@eeckstein eeckstein deleted the fix-const-folding branch February 15, 2024 09:06
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.

4 participants