commit 272fe0cbfe4d59a307389e20b3bf57099b182ebe (tree)
parent ab5a445d252ba090d25ae0c49a9b0820ffbb73d3
Author: Timon Kruiper <timonkruiper@gmail.com>
Date: Thu, 8 Apr 2021 14:20:40 +0200
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.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/Module.zig b/src/Module.zig
@@ -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) {