authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-08-02 17:48:15+02:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-08-02 17:49:36+02:00
log447a4cc115f5d105d49fcb3e970082b89e5a46dd
tree45fae965683e5638efa0bd2bf2d22ad173769b6e
parentc5afefec427f2f2aeb25fe8f7114b5a0a6aa1129

autodoc: fix off-by-1 error in analysis of pointer types


1 files changed, 2 insertions(+), 2 deletions(-)

src/Autodoc.zig+2-2
...@@ -1399,7 +1399,6 @@ fn walkInstruction(...@@ -1399,7 +1399,6 @@ fn walkInstruction(
1399 const extra = file.zir.extraData(Zir.Inst.PtrType, ptr.payload_index);1399 const extra = file.zir.extraData(Zir.Inst.PtrType, ptr.payload_index);
1400 var extra_index = extra.end;1400 var extra_index = extra.end;
14011401
1402 const type_slot_index = self.types.items.len;
1403 const elem_type_ref = try self.walkRef(1402 const elem_type_ref = try self.walkRef(
1404 file,1403 file,
1405 parent_scope,1404 parent_scope,
...@@ -1446,6 +1445,7 @@ fn walkInstruction(...@@ -1446,6 +1445,7 @@ fn walkInstruction(
1446 host_size = ref_result.expr;1445 host_size = ref_result.expr;
1447 }1446 }
14481447
1448 const type_slot_index = self.types.items.len;
1449 try self.types.append(self.arena, .{1449 try self.types.append(self.arena, .{
1450 .Pointer = .{1450 .Pointer = .{
1451 .size = ptr.size,1451 .size = ptr.size,
...@@ -2994,7 +2994,7 @@ fn tryResolveRefPath(...@@ -2994,7 +2994,7 @@ fn tryResolveRefPath(
2994 "TODO: handle `{s}`in tryResolveRefPath\nInfo: {}",2994 "TODO: handle `{s}`in tryResolveRefPath\nInfo: {}",
2995 .{ @tagName(resolved_parent), resolved_parent },2995 .{ @tagName(resolved_parent), resolved_parent },
2996 );2996 );
2997 path[i + 1] = (try self.cteTodo("match failure")).expr;2997 path[i + 1] = (try self.cteTodo("<match failure>")).expr;
2998 continue :outer;2998 continue :outer;
2999 },2999 },
3000 .comptimeExpr, .call, .typeOf => {3000 .comptimeExpr, .call, .typeOf => {