diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index ca6d9d800bc85a4aa22ecbc2ebbdddd70bdafdcb..4ce2e041c05dc9f5d348397700b654605139267b 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -934,8 +934,9 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { // If it's in the registers table, need to associate the register with the // new instruction. const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; - const entry = branch.registers.getEntry(toCanonicalReg(reg)).?; - entry.value = .{ .inst = inst }; + if (branch.registers.getEntry(toCanonicalReg(reg))) |entry| { + entry.value = .{ .inst = inst }; + } log.debug("reusing {} => {*}", .{reg, inst}); }, .stack_offset => |off| {