From 02252f3f078c82375857fb5642167ef0e3a72383 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 4 Nov 2020 22:23:59 +1100 Subject: [PATCH] std: workaround #280 in prctl --- lib/std/os.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index d593f816c98290768f352b6c930631bcee9d0495..50b0b9b6fd955b318ff64bbeef377a6eea5e121b 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -5643,7 +5643,10 @@ pub fn prctl(option: i32, args: anytype) PrctlError!u31 { @compileError("prctl takes a maximum of 4 optional arguments"); var buf: [4]usize = undefined; - inline for (args) |arg, i| buf[i] = arg; + { + comptime var i = 0; + inline while (i < args.len) : (i += 1) buf[i] = args[i]; + } const rc = system.prctl(option, buf[0], buf[1], buf[2], buf[3]); switch (errno(rc)) { -- 2.54.0