stage2: fix bug in ZIR gen of global comptime block

A global comptime block did not end with a break_inline instruction
which caused an assertion to be hit.
This commit is contained in:
Timon Kruiper 2021-04-08 14:20:40 +02:00
parent ab5a445d25
commit 272fe0cbfe

View File

@ -2513,6 +2513,7 @@ fn astgenAndSemaDecl(mod: *Module, decl: *Decl) !bool {
const block_expr = node_datas[decl_node].lhs;
_ = try AstGen.comptimeExpr(&gen_scope, &gen_scope.base, .none, block_expr);
_ = try gen_scope.addBreak(.break_inline, gen_scope.break_block, .void_value);
const code = try gen_scope.finish();
if (std.builtin.mode == .Debug and mod.comp.verbose_ir) {