windows x86_64 C ABI: pass byref structs as byref_mut

This commit is contained in:
Veikka Tuominen 2023-01-16 14:46:50 +02:00
parent 8b35f09f4a
commit 24646b8b5d
2 changed files with 1 additions and 3 deletions

View File

@ -10668,8 +10668,7 @@ const ParamTypeIterator = struct {
.memory => {
it.zig_index += 1;
it.llvm_index += 1;
it.byval_attr = true;
return .byref;
return .byref_mut;
},
.sse => {
it.zig_index += 1;

View File

@ -1032,7 +1032,6 @@ extern fn c_modify_by_ref_param(ByRef) ByRef;
test "C function modifies by ref param" {
if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .windows and builtin.mode != .Debug) return error.SkipZigTest;
const res = c_modify_by_ref_param(.{ .val = 1, .arr = undefined });
try expect(res.val == 42);