authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-29 17:25:10-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-29 17:25:10-07:00
log478dac53468704909cd97bb5d47f9b1b92972022
tree5aaafe5ba4edec412ba7f26d37603b63b8f3cc5c
parent9e49a65e1bd474f0f678465fb4b965ddc5899226

Sema: skip analysis of empty enum blocks

For these, the ZIR code has an empty block rather than a block with a single `break_inline` instruction.

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

src/Sema.zig+3-1
...@@ -900,7 +900,9 @@ fn zirEnumDecl(...@@ -900,7 +900,9 @@ fn zirEnumDecl(
900 };900 };
901 defer assert(enum_block.instructions.items.len == 0); // should all be comptime instructions901 defer assert(enum_block.instructions.items.len == 0); // should all be comptime instructions
902902
903 _ = try enum_sema.analyzeBody(&enum_block, body);903 if (body.len != 0) {
904 _ = try enum_sema.analyzeBody(&enum_block, body);
905 }
904906
905 sema.branch_count = enum_sema.branch_count;907 sema.branch_count = enum_sema.branch_count;
906 sema.branch_quota = enum_sema.branch_quota;908 sema.branch_quota = enum_sema.branch_quota;