From ab7b1672704d180c1c9e84dcdedf78c1f33cae46 Mon Sep 17 00:00:00 2001 From: Peter Li Date: Sun, 1 Nov 2026 21:24:31 -0800 Subject: [PATCH] DXIL: keep the library prologue's use marks per thread markUses kept the array it marks in a static, which concurrent library compiles under --job shared: one could mark into another's array, or index past its own. Make it thread-local. --- src/dxil/emit.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxil/emit.zig b/src/dxil/emit.zig index 90e9663..86f3a9f 100644 --- a/src/dxil/emit.zig +++ b/src/dxil/emit.zig @@ -1237,7 +1237,7 @@ const Emitter = struct { fn markUses(a: Allocator, inst: module.Inst, used: []bool) void { const M = struct { - var u: []bool = &.{}; + threadlocal var u: []bool = &.{}; fn v(_: []const u32, x: Value) Value { if (x == .inst) u[x.inst] = true; return x;