authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-27 17:38:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-27 18:59:13-07:00
log3e0a46281c91f7706add98df2a009697170822cb
tree9d9194c995012f3e457a0b1089fb1f76a2d3bc99
parent1c2e65fe1de66e8ebb8953a67fe327bae3251f30

stage2: fix function calls always having void return type


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

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