File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3980,7 +3980,8 @@ fn createFlexibleMemberFn(
39803980
39813981 // return @ptrCast(&self.*.<field_name>);
39823982 const address_of = try ZigTag .address_of .create (t .arena , field_access );
3983- const casted = try ZigTag .ptr_cast .create (t .arena , address_of );
3983+ const aligned = try ZigTag .align_cast .create (t .arena , address_of );
3984+ const casted = try ZigTag .ptr_cast .create (t .arena , aligned );
39843985 const return_stmt = try ZigTag .@"return" .create (t .arena , casted );
39853986 const body = try ZigTag .block_single .create (t .arena , return_stmt );
39863987
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ struct bar { int x; int y[0]; };
77// x: c_int = 0,
88// _y: [0]c_int = @import("std").mem.zeroes([0]c_int),
99// pub fn y(self: anytype) __helpers.FlexibleArrayType(@TypeOf(self), @typeInfo(@TypeOf(self.*._y)).array.child) {
10- // return @ptrCast(&self.*._y);
10+ // return @ptrCast(@alignCast( &self.*._y) );
1111// }
1212// };
1313// pub const struct_bar = extern struct {
1414// x: c_int = 0,
1515// _y: [0]c_int = @import("std").mem.zeroes([0]c_int),
1616// pub fn y(self: anytype) __helpers.FlexibleArrayType(@TypeOf(self), @typeInfo(@TypeOf(self.*._y)).array.child) {
17- // return @ptrCast(&self.*._y);
17+ // return @ptrCast(@alignCast( &self.*._y) );
1818// }
1919// };
You can’t perform that action at this time.
0 commit comments