motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 3e0a46281c91f7706add98df2a009697170822cb (tree)
parent 1c2e65fe1de66e8ebb8953a67fe327bae3251f30
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon, 27 Jul 2020 17:38:18 -0700

stage2: fix function calls always having void return type

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

diff --git a/src-self-hosted/Module.zig b/src-self-hosted/Module.zig @@ -2828,8 +2828,10 @@ fn analyzeInstCall(self: *Module, scope: *Scope, inst: *zir.Inst.Call) InnerErro casted_args[i] = try self.coerce(scope, fn_param_types[i], uncasted_arg); } + const ret_type = func.ty.fnReturnType(); + const b = try self.requireRuntimeBlock(scope, inst.base.src); - return self.addCall(b, inst.base.src, Type.initTag(.void), func, casted_args); + return self.addCall(b, inst.base.src, ret_type, func, casted_args); } fn analyzeInstFn(self: *Module, scope: *Scope, fn_inst: *zir.Inst.Fn) InnerError!*Inst {