diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-02-20 13:41:24 +0100 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-02-20 23:36:47 +0100 |
| commit | ec7293422d28d253ffc3922684f03cecd3f15f4d (patch) | |
| tree | 7e8d9625da83648cfdf29f2fc4ef580a07d81419 /src/codegen | |
| parent | 2291560424b3cfa614cb0320d73e41aa1f5fa221 (diff) | |
| download | zig-ec7293422d28d253ffc3922684f03cecd3f15f4d.tar.gz zig-ec7293422d28d253ffc3922684f03cecd3f15f4d.zip | |
llvm: fix c abi for structs not passed in registers
Closes #18916
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/llvm.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 017abf8eaf..0d3ae8eb19 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -11443,6 +11443,12 @@ const ParamTypeIterator = struct { it.llvm_index += 1; return .abi_sized_int; } + if (it.llvm_index + types_index > 6) { + it.zig_index += 1; + it.llvm_index += 1; + it.byval_attr = true; + return .byref; + } switch (ip.indexToKey(ty.toIntern())) { .struct_type => |struct_type| { assert(struct_type.haveLayout(ip)); |
