-
Notifications
You must be signed in to change notification settings - Fork 281
transpile: Factor out common function for address-of and array-decay #1446
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
Conversation
07d7881 to
bbeb6de
Compare
07779b3 to
5a55ba9
Compare
|
Could this PR (and #1478) be reviewed soon? It's becoming rather a blocker for other things at the moment. |
|
#1478 seems fine to me, I approved it. For this one, you might need to add some reviewers (I'll ask tomorrow if anyone wants to volunteer). |
I don't think regular users can add/request reviewers on this repo? Unless I'm missing something. |
fw-immunant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, but I'd like a few inline questions answered before r+. Thanks for working on this refactor--this is rather hairy code.
|
Modulo comments on #1478, which this includes as its first commit, LGTM. |
Depends on #1478.
volatile int*Triggers Invalid Pointer Cast in Transpiled Rust #1240.(void*)arrayCast Still Emits Invalid*mut _Despite Fix for Scalar-to-void* Casts (Related to #1077) #1238.This combines handling of the address-of and array-decay cast into a common function.
In the current code, this check for whether the created pointer type has a different pointee than the actual desired pointee type is only applied to array-to-pointer decays but not address-of. I left it that way, but perhaps it's also good to have it for address-of?
c2rust/c2rust-transpile/src/translator/mod.rs
Lines 4837 to 4843 in bbeb6de