From 447a4cc115f5d105d49fcb3e970082b89e5a46dd Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Tue, 2 Aug 2022 17:48:15 +0200 Subject: [PATCH] autodoc: fix off-by-1 error in analysis of pointer types --- src/Autodoc.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Autodoc.zig b/src/Autodoc.zig index 1ed269455..35f9dc7de 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -1399,7 +1399,6 @@ fn walkInstruction( const extra = file.zir.extraData(Zir.Inst.PtrType, ptr.payload_index); var extra_index = extra.end; - const type_slot_index = self.types.items.len; const elem_type_ref = try self.walkRef( file, parent_scope, @@ -1446,6 +1445,7 @@ fn walkInstruction( host_size = ref_result.expr; } + const type_slot_index = self.types.items.len; try self.types.append(self.arena, .{ .Pointer = .{ .size = ptr.size, @@ -2994,7 +2994,7 @@ fn tryResolveRefPath( "TODO: handle `{s}`in tryResolveRefPath\nInfo: {}", .{ @tagName(resolved_parent), resolved_parent }, ); - path[i + 1] = (try self.cteTodo("match failure")).expr; + path[i + 1] = (try self.cteTodo("")).expr; continue :outer; }, .comptimeExpr, .call, .typeOf => {