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.
This commit is contained in:
Andrew Kelley 2021-04-29 17:25:10 -07:00
parent 9e49a65e1b
commit 478dac5346

View File

@ -900,7 +900,9 @@ fn zirEnumDecl(
};
defer assert(enum_block.instructions.items.len == 0); // should all be comptime instructions
_ = try enum_sema.analyzeBody(&enum_block, body);
if (body.len != 0) {
_ = try enum_sema.analyzeBody(&enum_block, body);
}
sema.branch_count = enum_sema.branch_count;
sema.branch_quota = enum_sema.branch_quota;