From 6d27341b96240a4ae70c794eb05dec452fd31451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20=22xq=22=20Quei=C3=9Fner?= Date: Thu, 5 May 2022 10:24:41 +0200 Subject: [PATCH] Fixes comptime 'error: cannot assign to constant' error in siphash. --- lib/std/crypto/siphash.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/crypto/siphash.zig b/lib/std/crypto/siphash.zig index 50706a0f35..dff8005b31 100644 --- a/lib/std/crypto/siphash.zig +++ b/lib/std/crypto/siphash.zig @@ -78,9 +78,12 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round pub fn update(self: *Self, b: []const u8) void { std.debug.assert(b.len % 8 == 0); + const inl = std.builtin.CallOptions{ .modifier = .always_inline }; + var off: usize = 0; while (off < b.len) : (off += 8) { - @call(.{ .modifier = .always_inline }, self.round, .{b[off..][0..8].*}); + const blob = b[off..][0..8].*; + @call(inl, round, .{ self, blob }); } self.msg_len +%= @truncate(u8, b.len);