zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 478dac53468704909cd97bb5d47f9b1b92972022 (tree)
parent 9e49a65e1bd474f0f678465fb4b965ddc5899226
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 29 Apr 2021 17:25:10 -0700

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.

Diffstat:
Msrc/Sema.zig | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/Sema.zig b/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;