Skip to content

Conversation

@qsctr
Copy link
Collaborator

@qsctr qsctr commented Jan 23, 2026

Fixes #1716.

Also improves the comment for the general pointer-to-pointer cast case where the pointer is unchanged.

@qsctr qsctr self-assigned this Jan 23, 2026
Comment on lines +946 to +950
-- repr(transparent) pointer-to-pointer cast
(M.Misc, M.TyRawPtr (M.TyAdt an1 _ _) m1, M.TyRawPtr _ _)
| Just adt1 <- findAdt' col an1
, Just fieldTy1 <- reprTransparentFieldTy col adt1
-> evalCast' M.Misc (M.TyRawPtr fieldTy1 m1) e ty2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have a similar case in transmuteExp? At the moment, crucible-mir errors at simulation time if you rewrite the cast_from_ptr_repr_transparent test case to use transmute instead of a cast, and I imagine that it's for largely the same reasons that this case fixes.

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 this pull request may close these issues.

crucible-mir: Support pointer-to-pointer casts where the source is a pointer to a #[repr(transparent)] type

3 participants