diff options
| author | Veikka Tuominen <git@vexu.eu> | 2024-01-08 01:23:17 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2024-01-08 06:57:06 +0200 |
| commit | faeb0ef032cbe941d5593c9e72ebfefaa994f70b (patch) | |
| tree | 9f50ffedb095a117e034e036e8ec9dbc19343c3d /src/codegen/llvm.zig | |
| parent | 3f6e651d5a850bb9623e628aa83cd9d70e83c417 (diff) | |
| download | zig-faeb0ef032cbe941d5593c9e72ebfefaa994f70b.tar.gz zig-faeb0ef032cbe941d5593c9e72ebfefaa994f70b.zip | |
llvm: optional slices cannot be passed in parts when they allowzero
Closes #18428
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 91c4faffcc..0eecbb4f87 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -11197,7 +11197,9 @@ const ParamTypeIterator = struct { .Unspecified, .Inline => { it.zig_index += 1; it.llvm_index += 1; - if (ty.isSlice(mod) or (ty.zigTypeTag(mod) == .Optional and ty.optionalChild(mod).isSlice(mod))) { + if (ty.isSlice(mod) or + (ty.zigTypeTag(mod) == .Optional and ty.optionalChild(mod).isSlice(mod) and !ty.ptrAllowsZero(mod))) + { it.llvm_index += 1; return .slice; } else if (isByRef(ty, mod)) { |
