mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 19:42:56 +00:00
llvm: Don't set nonnull attribute on allowzero slices.
This commit is contained in:
parent
8e00f47685
commit
9948a093ff
@ -1658,7 +1658,7 @@ pub const Object = struct {
|
||||
try attributes.addParamAttr(llvm_arg_i, .@"noalias", &o.builder);
|
||||
}
|
||||
}
|
||||
if (param_ty.zigTypeTag(zcu) != .optional) {
|
||||
if (param_ty.zigTypeTag(zcu) != .optional and !ptr_info.flags.is_allowzero) {
|
||||
try attributes.addParamAttr(llvm_arg_i, .nonnull, &o.builder);
|
||||
}
|
||||
if (ptr_info.flags.is_const) {
|
||||
@ -5756,7 +5756,7 @@ pub const FuncGen = struct {
|
||||
try attributes.addParamAttr(llvm_arg_i, .@"noalias", &o.builder);
|
||||
}
|
||||
}
|
||||
if (param_ty.zigTypeTag(zcu) != .optional) {
|
||||
if (param_ty.zigTypeTag(zcu) != .optional and !ptr_info.flags.is_allowzero) {
|
||||
try attributes.addParamAttr(llvm_arg_i, .nonnull, &o.builder);
|
||||
}
|
||||
if (ptr_info.flags.is_const) {
|
||||
|
Loading…
Reference in New Issue
Block a user