authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-06-02 16:29:22+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-19 19:10:12-07:00
log06ee275295b6e0674557069a09af0c3d037ff046
tree6fa3654d901fb64b80eb029d89f1ba91c54ac175
parentdd9a01818562dd4a34479d867ae0521b236fbf7b

autodoc: fix crash when handling siwtch_block instructions


1 files changed, 9 insertions(+), 4 deletions(-)

src/Autodoc.zig+9-4
...@@ -2679,10 +2679,15 @@ fn walkInstruction(...@@ -2679,10 +2679,15 @@ fn walkInstruction(
2679 array_data[scalar_i] = item.expr.as.exprArg;2679 array_data[scalar_i] = item.expr.as.exprArg;
26802680
2681 const body_ref = @intToEnum(Ref, file.zir.extra[extra_index]);2681 const body_ref = @intToEnum(Ref, file.zir.extra[extra_index]);
2682 const body_item = try self.walkRef(file, parent_scope, body_ref, false);2682 if (extra.data.bits.is_ref) {
2683 _ = body_item;2683 const body_item = try self.walkRef(file, parent_scope, body_ref, false);
26842684 _ = body_item;
2685 array_data[scalar_i] = item.expr.as.exprArg;2685
2686 array_data[scalar_i] = item.expr.as.exprArg;
2687 } else {
2688 array_data[scalar_i] = 0;
2689 // TODO: this is wrong, decide an actual strategy
2690 }
2686 // std.debug.print("{s}\n", .{sep});2691 // std.debug.print("{s}\n", .{sep});
2687 // std.debug.print("body item_ref = {any}\n", .{item_ref});2692 // std.debug.print("body item_ref = {any}\n", .{item_ref});
2688 // std.debug.print("body item = {any}\n", .{item});2693 // std.debug.print("body item = {any}\n", .{item});