Skip to content

Conversation

@Rua
Copy link
Contributor

@Rua Rua commented Nov 4, 2025

Depends on #1478.

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?

// If the target pointee type is different from the source element type,
// then we need to cast the ptr type as well.
if arg_cty_kind.element_ty().map_or(false, |arg_element_cty| {
arg_element_cty != pointee_cty.ctype
}) {
needs_cast = true;
}

@Rua Rua force-pushed the addr-of-refactor branch 12 times, most recently from 07d7881 to bbeb6de Compare November 6, 2025 09:39
@Rua Rua force-pushed the addr-of-refactor branch 2 times, most recently from 07779b3 to 5a55ba9 Compare November 26, 2025 17:37
@Rua
Copy link
Contributor Author

Rua commented Nov 28, 2025

Could this PR (and #1478) be reviewed soon? It's becoming rather a blocker for other things at the moment.

@ahomescu
Copy link
Contributor

ahomescu commented Dec 2, 2025

#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).

@Rua
Copy link
Contributor Author

Rua commented Dec 2, 2025

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.

Copy link
Contributor

@fw-immunant fw-immunant left a 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.

@fw-immunant
Copy link
Contributor

Modulo comments on #1478, which this includes as its first commit, LGTM.

@Rua Rua force-pushed the addr-of-refactor branch from b9a3d0b to c305c2d Compare December 3, 2025 17:27
@Rua Rua force-pushed the addr-of-refactor branch from c305c2d to 18aae96 Compare December 4, 2025 08:48
@fw-immunant fw-immunant merged commit fc012ad into immunant:master Dec 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants