| ... | @@ -175,10 +175,11 @@ inline fn copyRange4( | ... | @@ -175,10 +175,11 @@ inline fn copyRange4( |
| 175 | const last = len - copy_len; | 175 | const last = len - copy_len; |
| 176 | const pen = last - b; | 176 | const pen = last - b; |
| 177 | | 177 | |
| 178 | dest[0..copy_len].* = src[0..copy_len].*; | 178 | const Int = @Type(.{ .int = .{ .signedness = .unsigned, .bits = copy_len * 8 } }); |
| 179 | dest[b..][0..copy_len].* = src[b..][0..copy_len].*; | 179 | @as(*align(1) Int, @ptrCast(dest[0..copy_len])).* = @as(*align(1) const Int, @ptrCast(src[0..copy_len])).*; |
| 180 | dest[pen..][0..copy_len].* = src[pen..][0..copy_len].*; | 180 | @as(*align(1) Int, @ptrCast(dest[b..][0..copy_len])).* = @as(*align(1) const Int, @ptrCast(src[b..][0..copy_len])).*; |
| 181 | dest[last..][0..copy_len].* = src[last..][0..copy_len].*; | 181 | @as(*align(1) Int, @ptrCast(dest[pen..][0..copy_len])).* = @as(*align(1) const Int, @ptrCast(src[pen..][0..copy_len])).*; |
| | 182 | @as(*align(1) Int, @ptrCast(dest[last..][0..copy_len])).* = @as(*align(1) const Int, @ptrCast(src[last..][0..copy_len])).*; |
| 182 | } | 183 | } |
| 183 | | 184 | |
| 184 | test "memcpy" { | 185 | test "memcpy" { |