Skip to content

Commit 262e32b

Browse files
committed
Randomisation can be used for fuzz testing.
1 parent b883eca commit 262e32b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

active/0000-undefined-struct-layout.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ struct B {
5656
then the struct is (strictly) only 18 bytes (but the alignment
5757
requirements of `u64` forces it to take up 24).
5858

59-
(Having an undefined layout does allow for possible security
59+
Having an undefined layout does allow for possible security
6060
improvements, like randomising struct fields, but this can trivially
61-
be done with a syntax extension that reorders them in the AST itself,
62-
and so is not part of this proposal.)
61+
be done with a syntax extension that can be attached to a struct to
62+
reorder the fields in the AST itself. That said, there may be benefits
63+
from being able to randomise all structs in a program
64+
automatically/for testing, effectively fuzzing code (especially
65+
`unsafe` code).
6366

6467
Notably, Rust's `enum`s already have undefined layout, and provide the
6568
`#[repr]` attribute to control layout more precisely (specifically,

0 commit comments

Comments
 (0)