authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-18 18:30:06-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-18 18:30:06-07:00
logf416535768fc30195cad6cd481f73fd1e80082aa
tree2ec26d70f41a1382b736b606ebfa094ace62573e
parent53987c932c9d62cc9cdae3d523fb62756ce83ca9

work around compiler bug regarding generic function slice alignment

See #7495

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

lib/std/crypto/tlcsprng.zig+3-1
......@@ -117,7 +117,9 @@ fn setupPthreadAtforkAndFill(buffer: []u8) void {
117117}
118118
119119fn childAtForkHandler() callconv(.C) void {
120 const wipe_slice = @ptrCast([*]u8, &wipe_me)[0..@sizeOf(@TypeOf(wipe_me))];
120 // TODO this is a workaround for https://github.com/ziglang/zig/issues/7495
121 var wipe_slice: []u8 = undefined;
122 wipe_slice = @ptrCast([*]u8, &wipe_me)[0..@sizeOf(@TypeOf(wipe_me))];
121123 std.crypto.utils.secureZero(u8, wipe_slice);
122124}
123125