Skip to content

Conversation

@Stevengre
Copy link
Contributor

No description provided.

@Stevengre Stevengre marked this pull request as ready for review November 7, 2025 05:26
@Stevengre Stevengre self-assigned this Nov 7, 2025
Base automatically changed from jh/zero-sized to master November 10, 2025 08:29

```k
// `prove-rs/interior-mut3.rs` needs this
// TODO: check its correctness, I assume the pointer offset is the address here and we can use it to recover the PtrLocal
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately this is not correct. The PTR_OFFSET here is an index into an array of elements of a certain type T. To get what would be an address in a byte-addressed memory you have to multiply it with the size of one element in bytes. sizeof<T>.
This becomes interesting for the alignment check when pointers are cast from one element type to another.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The PTR_OFFSET is a local OFFSET for the structure?

@Stevengre Stevengre marked this pull request as draft November 12, 2025 10:13
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.

3 participants