authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-25 19:12:49+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-25 19:12:49+02:00
logdc29d866490e9d886f838e23cb085a9e28c0143b
tree85bbdb491928181f2fc8841ea2c3dd141fbd2412
parent54db36cd88835ed6b9d9584d9568e9aa72e41480

std: Fix wrong alignOf expression

Mostly harmless but conceptually wrong, luckily it hasn't tripped any safety check.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/os/linux/tls.zig+2-2
...@@ -248,7 +248,7 @@ fn initTLS() void {...@@ -248,7 +248,7 @@ fn initTLS() void {
248 tls_data = @intToPtr([*]u8, img_base + phdr.p_vaddr)[0..phdr.p_filesz];248 tls_data = @intToPtr([*]u8, img_base + phdr.p_vaddr)[0..phdr.p_filesz];
249 tls_data_alloc_size = phdr.p_memsz;249 tls_data_alloc_size = phdr.p_memsz;
250 } else {250 } else {
251 tls_align_factor = @alignOf(*usize);251 tls_align_factor = @alignOf(usize);
252 tls_data = &[_]u8{};252 tls_data = &[_]u8{};
253 tls_data_alloc_size = 0;253 tls_data_alloc_size = 0;
254 }254 }
...@@ -308,7 +308,7 @@ fn initTLS() void {...@@ -308,7 +308,7 @@ fn initTLS() void {
308}308}
309309
310fn alignPtrCast(comptime T: type, ptr: [*]u8) callconv(.Inline) *T {310fn alignPtrCast(comptime T: type, ptr: [*]u8) callconv(.Inline) *T {
311 return @ptrCast(*T, @alignCast(@alignOf(*T), ptr));311 return @ptrCast(*T, @alignCast(@alignOf(T), ptr));
312}312}
313313
314/// Initializes all the fields of the static TLS area and returns the computed314/// Initializes all the fields of the static TLS area and returns the computed