diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-22 17:29:28 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:12 -0800 |
| commit | 187d0a692de2f00e64a446548873f7a12d9ddb4f (patch) | |
| tree | 753349f54dc9b6e3af38557f441665cbc7f0a177 /src | |
| parent | 7c1236e267e536379f8b91148117fb0b8e965334 (diff) | |
| download | zig-187d0a692de2f00e64a446548873f7a12d9ddb4f.tar.gz zig-187d0a692de2f00e64a446548873f7a12d9ddb4f.zip | |
compiler: handle cancelation from finishPrelinkQueue
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 4 | ||||
| -rw-r--r-- | src/InternPool.zig | 1 | ||||
| -rw-r--r-- | src/link/Queue.zig | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 8b840b8d45..8e005992ec 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -5056,7 +5056,9 @@ fn dispatchPrelinkWork(comp: *Compilation, main_progress_node: std.Progress.Node } prelink_group.wait(io); - comp.link_queue.finishPrelinkQueue(comp); + comp.link_queue.finishPrelinkQueue(comp) catch |err| switch (err) { + error.Canceled => return, + }; } const JobError = Allocator.Error || Io.Cancelable; diff --git a/src/InternPool.zig b/src/InternPool.zig index 3076aa2cf3..69a64cbc45 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -11,7 +11,6 @@ const assert = std.debug.assert; const BigIntConst = std.math.big.int.Const; const BigIntMutable = std.math.big.int.Mutable; const Cache = std.Build.Cache; -const Io = std.Io; const Limb = std.math.big.Limb; const Hash = std.hash.Wyhash; const Zir = std.zig.Zir; diff --git a/src/link/Queue.zig b/src/link/Queue.zig index caa2cc1898..b716800bae 100644 --- a/src/link/Queue.zig +++ b/src/link/Queue.zig @@ -121,7 +121,7 @@ pub fn enqueueZcu( link.doZcuTask(comp, tid, task); } -pub fn finishPrelinkQueue(q: *Queue, comp: *Compilation) void { +pub fn finishPrelinkQueue(q: *Queue, comp: *Compilation) Io.Cancelable!void { if (q.future != null) { q.prelink_queue.close(comp.io); return; @@ -136,6 +136,7 @@ pub fn finishPrelinkQueue(q: *Queue, comp: *Compilation) void { } else |err| switch (err) { error.OutOfMemory => comp.link_diags.setAllocFailure(), error.LinkFailure => {}, + error.Canceled => |e| return e, } } } |
