authorgravatar for timonkruiper@gmail.comTimon Kruiper <timonkruiper@gmail.com> 2021-04-08 14:20:40+02:00
committergravatar for timonkruiper@gmail.comTimon Kruiper <timonkruiper@gmail.com> 2021-04-08 14:20:40+02:00
log272fe0cbfe4d59a307389e20b3bf57099b182ebe
tree4bee2de458927fd97547c36cb8bfe936368f6c28
parentab5a445d252ba090d25ae0c49a9b0820ffbb73d3

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.

1 files changed, 1 insertions(+), 0 deletions(-)

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