aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
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)) {