mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 14:59:14 +00:00
AstGen: fix function declarations
They were putting their return type expressions into the wrong ZIR block, resulting in a compiler crash.
This commit is contained in:
parent
47f2463b5c
commit
786e238a7f
@ -3004,9 +3004,9 @@ fn fnDecl(
|
||||
break :inst try comptimeExpr(&decl_gz, params_scope, .{ .ty = .const_slice_u8_type }, fn_proto.ast.section_expr);
|
||||
};
|
||||
|
||||
var ret_gz = gz.makeSubBlock(params_scope);
|
||||
var ret_gz = decl_gz.makeSubBlock(params_scope);
|
||||
defer ret_gz.instructions.deinit(gpa);
|
||||
const ret_ty = try expr(&decl_gz, params_scope, coerced_type_rl, fn_proto.ast.return_type);
|
||||
const ret_ty = try expr(&ret_gz, params_scope, coerced_type_rl, fn_proto.ast.return_type);
|
||||
const ret_br = try ret_gz.addBreak(.break_inline, 0, ret_ty);
|
||||
|
||||
const cc: Zir.Inst.Ref = blk: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user