-
-
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
Zig Version
0.9.1
Steps to Reproduce
Just because an array is aligned, it does not imply that each member of the array is aligned, nor does it imply that arbitrary slices of it are aligned.
test "alignment test" {
var buf: [1024]u8 align(64) = undefined;
var start: usize = 1;
var end: usize = undefined;
std.debug.print("\n", .{});
std.debug.print("buf[start..end] => {s}\n", .{@TypeOf(buf[start..end])});
std.debug.print("&buf[start..end][0] => {s}\n", .{@TypeOf(&(buf[start..end][0]))});
std.debug.print("&buf[start] => {s}\n", .{@TypeOf(&(buf[start]))});
}
Expected Behavior
buf[start..end] => []u8
&buf[start..end][0] => *u8
&buf[start] => *u8
Actual Behavior
buf[start..end] => []align(64) u8
&buf[start..end][0] => *align(64) u8
&buf[start] => *u8
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.