You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is provenance required in order to perform zero-sized accesses? Following up on rust-lang/rust#116677 (comment), I understand that it is sound (e.g. per the ptr module docs) to perform a zero-sized load or store using a pointer derived from any non-zero integer literal. Since integers do not have provenance, this implies that zero-sized accesses do not require valid provenance. Is that correct?
The text was updated successfully, but these errors were encountered:
I believe this is covered by the FCP on zero-sized accesses #472 (which was approved but IIRC still has some implementation work to avoid LLVM miscompilations). All zero-sized accesses are allowed, including those with invalid provenance or no provenance. The ptr module docs have an exception for provenance to deallocated memory, but hopefully this can be removed at some point.
Is provenance required in order to perform zero-sized accesses? Following up on rust-lang/rust#116677 (comment), I understand that it is sound (e.g. per the
ptr
module docs) to perform a zero-sized load or store using a pointer derived from any non-zero integer literal. Since integers do not have provenance, this implies that zero-sized accesses do not require valid provenance. Is that correct?The text was updated successfully, but these errors were encountered: