Skip to content

Commit 1983bd4

Browse files
committed
Add ualigned pointer access to UB list.
Fixes rust-lang#49
1 parent 9bf9f64 commit 1983bd4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/behavior-considered-undefined.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ to let `safe` code exhibit these behaviors.
77

88
* Data races.
99
* Dereferencing a null or dangling raw pointer.
10+
* Unaligned pointer reading and writing outside of [`read_unaligned`]
11+
and [`write_unaligned`].
1012
* Reads of [undef] \(uninitialized) memory.
1113
* Breaking the [pointer aliasing rules] on accesses through raw pointers;
1214
a subset of the rules used by C.
@@ -35,4 +37,6 @@ to let `safe` code exhibit these behaviors.
3537
[undef]: http://llvm.org/docs/LangRef.html#undefined-values
3638
[`offset`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.offset
3739
[`std::ptr::copy_nonoverlapping_memory`]: https://doc.rust-lang.org/std/ptr/fn.copy_nonoverlapping.html
38-
[`UnsafeCell<U>`]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
40+
[`UnsafeCell<U>`]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
41+
[`read_unaligned`]: https://doc.rust-lang.org/std/ptr/fn.read_unaligned.html
42+
[`write_unaligned`]: https://doc.rust-lang.org/std/ptr/fn.write_unaligned.html

0 commit comments

Comments
 (0)