Skip to content
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

FMA implementation subtly incorrect #200

Open
gnzlbg opened this issue Jul 6, 2019 · 2 comments
Open

FMA implementation subtly incorrect #200

gnzlbg opened this issue Jul 6, 2019 · 2 comments

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Jul 6, 2019

It appears that unsigned integer subtraction was mapped to Sub::sub(a, b) in Rust (a - b), instead of a.wrapping_sub(b). In C, unsigned integer subtraction wraps, but in rust, unless wrapping_sub is used, it panics on overflow in debug builds, and has UB in release builds.

@Lokathor
Copy link
Contributor

It is not UB in release builds, it is wrapping in release builds.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 28, 2019

Indeed. So something else must be off as well, because it was producing segfaults for me in release.

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

No branches or pull requests

2 participants