diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-24 21:12:01 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-24 21:21:05 -0500 |
| commit | 15d415e10b81a66fa3b887fb2a0c20bbcd614d94 (patch) | |
| tree | 10a61530b2b3d335cb8239d269b42569b8e932d8 /src/analyze.cpp | |
| parent | 34b1ebefaab2e8f5c322bc96388bb4fefec31027 (diff) | |
| download | zig-15d415e10b81a66fa3b887fb2a0c20bbcd614d94.tar.gz zig-15d415e10b81a66fa3b887fb2a0c20bbcd614d94.zip | |
make std.mem.toSlice use null terminated pointers
and fix the fallout
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index cd00e4d301..7c9171d74a 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -7792,7 +7792,8 @@ static void resolve_llvm_types_slice(CodeGen *g, ZigType *type, ResolveStatus wa bool done = false; if (ptr_type->data.pointer.is_const || ptr_type->data.pointer.is_volatile || - ptr_type->data.pointer.explicit_alignment != 0 || ptr_type->data.pointer.allow_zero) + ptr_type->data.pointer.explicit_alignment != 0 || ptr_type->data.pointer.allow_zero || + ptr_type->data.pointer.sentinel != nullptr) { ZigType *peer_ptr_type = get_pointer_to_type_extra(g, child_type, false, false, PtrLenUnknown, 0, 0, 0, false); @@ -7811,7 +7812,8 @@ static void resolve_llvm_types_slice(CodeGen *g, ZigType *type, ResolveStatus wa ZigType *child_ptr_type = child_type->data.structure.fields[slice_ptr_index]->type_entry; assert(child_ptr_type->id == ZigTypeIdPointer); if (child_ptr_type->data.pointer.is_const || child_ptr_type->data.pointer.is_volatile || - child_ptr_type->data.pointer.explicit_alignment != 0 || child_ptr_type->data.pointer.allow_zero) + child_ptr_type->data.pointer.explicit_alignment != 0 || child_ptr_type->data.pointer.allow_zero || + child_ptr_type->data.pointer.sentinel != nullptr) { ZigType *grand_child_type = child_ptr_type->data.pointer.child_type; ZigType *bland_child_ptr_type = get_pointer_to_type_extra(g, grand_child_type, false, false, |
