-
Notifications
You must be signed in to change notification settings - Fork 4
feat(rt): transmute pointer to int #812
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
base: master
Are you sure you want to change the base?
Conversation
70da3cb to
fcab480
Compare
|
|
||
| ```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 |
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.
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.
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.
The PTR_OFFSET is a local OFFSET for the structure?
6cada3e to
1642b91
Compare
1642b91 to
9a0cbd1
Compare
9a0cbd1 to
27434bd
Compare
No description provided.