authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-16 14:46:50+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-17 20:28:43+02:00
log24646b8b5d026a75deb5b3eace0e9142f0719da0
tree56e182a27d3e52b4b6eca48848cd21439256b1b6
parent8b35f09f4ae29eb2768d47e8a8bae0f4131d6bad

windows x86_64 C ABI: pass byref structs as byref_mut


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

src/codegen/llvm.zig+1-2
......@@ -10668,8 +10668,7 @@ const ParamTypeIterator = struct {
1066810668 .memory => {
1066910669 it.zig_index += 1;
1067010670 it.llvm_index += 1;
10671 it.byval_attr = true;
10672 return .byref;
10671 return .byref_mut;
1067310672 },
1067410673 .sse => {
1067510674 it.zig_index += 1;
test/c_abi/main.zig-1
......@@ -1032,7 +1032,6 @@ extern fn c_modify_by_ref_param(ByRef) ByRef;
10321032
10331033test "C function modifies by ref param" {
10341034 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
1035 if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .windows and builtin.mode != .Debug) return error.SkipZigTest;
10361035
10371036 const res = c_modify_by_ref_param(.{ .val = 1, .arr = undefined });
10381037 try expect(res.val == 42);