From 6582896ee00cd6b05b2f0a1d845b4a77d6bf7c25 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Mon, 17 Oct 2022 15:19:16 +0300 Subject: Sema: remove unresolved inferred allocs Closes #2557 --- src/Module.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 4edba007e9..396e92ed79 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -5612,6 +5612,18 @@ pub fn analyzeFnBody(mod: *Module, func: *Fn, arena: Allocator) SemaError!Air { else => |e| return e, }; + { + var it = sema.unresolved_inferred_allocs.keyIterator(); + while (it.next()) |ptr_inst| { + // The lack of a resolve_inferred_alloc means that this instruction + // is unused so it just has to be a no-op. + sema.air_instructions.set(ptr_inst.*, .{ + .tag = .alloc, + .data = .{ .ty = Type.initTag(.single_const_pointer_to_comptime_int) }, + }); + } + } + // If we don't get an error return trace from a caller, create our own. if (func.calls_or_awaits_errorable_fn and mod.comp.bin_file.options.error_return_tracing and -- cgit v1.2.3