-
Notifications
You must be signed in to change notification settings - Fork 707
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
Unsigned global set to -1 #1040
Comments
In fact it is! This happens because bindgen doesn't check for a signedness of type, it just emits as signed var with int_expr. |
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
I did use csmith but not C-reduce. I manually cut out everything except the part responsible for the error. |
Hi I'd like to start contributing and take this on as my first bug! |
Hey @josh0588! Thanks for your interest in working on this issue. It's now assigned to you! |
@josh0588 if you run into any questions, don't hesitate to ask :) |
@fitzgen thanks, it appears there already is a signed and unsigned version of the codegen helpers 'uint_ expr' and 'int_expr? but the match construct only calls the int_expr |
@josh0588 ah, I forgot about that! Looks like we jsut need to call it at the right time then :) |
Hi @josh0588 -- still making progress here? Any questions I can answer for you? |
We were not checking signed-ness and emitting the appropriate types. Fixes rust-lang#1040
I'm taking this due to inactivity and because it is being hit by @josh0588, if you're interested in hacking on another issue, let me know and I can help you find something :) |
Input C/C++ Header
Bindgen Invocation
Actual Results
Bindgen generates
which when compiled with
rustc --crate-type lib --test -o out failing2.rs
givesExpected Results
Not sure, but
18446744073709551615
does not look like-1
in the first place.Found with csmith fuzzing.
The text was updated successfully, but these errors were encountered: