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

rewriter: support casts needed by conversion to and from non-rewritten (fixed) types and rewritten types #964

Closed
aneksteind opened this issue Jun 16, 2023 · 0 comments · Fixed by #968
Assignees

Comments

@aneksteind
Copy link
Contributor

#960 introduces a feature where types mentioned in extern blocks, for example, aren't rewritten. This leads to a situation such as the following:

foo /* has CELL permissions */ = bar.connection /* is FIXED */

and with that the rewriter wants to generate a cast that's not yet supported:

TypeDesc { own: RawMut, qty: Single, pointee_ty: connection } -> TypeDesc { own: Cell, qty: Single, pointee_ty: connection }

The above is only one example of an unsupported cast kind that will need to be supported for lighttpd. The extent of the known cases have been temporarily disabled.

@aneksteind aneksteind self-assigned this Jun 16, 2023
aneksteind added a commit that referenced this issue Jul 6, 2023
Fixes #964 . The `lighttpd-minimal` test had failures due to unsupported
casts that the rewriter wanted to emit, namely in going to and from
`*mut T` and `Cell<T>`. This adds support for those casts via:

- an `as_ptr()` rewrite for `Cell<T>`, which produces the underlying
`*mut T`
- a `*mut T -> *const Cell<T> -> &Cell<T>` rewrite, accomplished through
a pointer-to-pointer cast followed by a reborrow `&*c` where `c: *const
Cell<T>`
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 a pull request may close this issue.

1 participant