aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2024-01-08 01:23:17 +0200
committerVeikka Tuominen <git@vexu.eu>2024-01-08 06:57:06 +0200
commitfaeb0ef032cbe941d5593c9e72ebfefaa994f70b (patch)
tree9f50ffedb095a117e034e036e8ec9dbc19343c3d /src/codegen
parent3f6e651d5a850bb9623e628aa83cd9d70e83c417 (diff)
downloadzig-faeb0ef032cbe941d5593c9e72ebfefaa994f70b.tar.gz
zig-faeb0ef032cbe941d5593c9e72ebfefaa994f70b.zip
llvm: optional slices cannot be passed in parts when they allowzero
Closes #18428
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig4
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)) {