From 24646b8b5d026a75deb5b3eace0e9142f0719da0 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Mon, 16 Jan 2023 14:46:50 +0200 Subject: [PATCH] windows x86_64 C ABI: pass byref structs as byref_mut --- src/codegen/llvm.zig | 3 +-- test/c_abi/main.zig | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 05bc957bbb..abcb9b4060 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -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; diff --git a/test/c_abi/main.zig b/test/c_abi/main.zig index 426651aa9e..b0d7a822d2 100644 --- a/test/c_abi/main.zig +++ b/test/c_abi/main.zig @@ -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);