Commit 478dac5346

Andrew Kelley <andrew@ziglang.org>
2021-04-30 02:25:10
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 parent 9e49a65
Changed files (1)
src/Sema.zig
@@ -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;