-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Description
I have two packed structs that look something like this:
pub const Inner= packed struct {
bits: u3,
more_bits: u6,
};
pub const Outer = packed struct {
padding: u5,
inner: Inner,
};
Then when assigning a inner value to outer, the compiler will miss-align the assignment. For example the code:
var r: *volatile Outer = SOME_VALID_ADDRESS;
fn t(inner: Inner) void {
r.inner = inner;
}
Will result in the first five bits of inner being assigned to padding.
zig version 0.9.0-dev.804+4c9d41730
Arch: Thumb
Model: Arm7tdmi
OS: Freestanding
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.