stage1: Prevent the creation of illegal pointer types

Changing the pointer length from Unknown to Single/C now resets the
sentinel value too.

Closes #5134
This commit is contained in:
LemonBoy
2020-04-22 16:54:11 +02:00
committed by Andrew Kelley
parent 173a143dd0
commit b5e72c0148
3 changed files with 10 additions and 3 deletions

View File

@@ -21090,7 +21090,7 @@ static ZigType *adjust_ptr_len(CodeGen *g, ZigType *ptr_type, PtrLen ptr_len) {
ptr_type->data.pointer.allow_zero,
ptr_type->data.pointer.vector_index,
ptr_type->data.pointer.inferred_struct_field,
ptr_type->data.pointer.sentinel);
(ptr_len != PtrLenUnknown) ? nullptr : ptr_type->data.pointer.sentinel);
}
static ZigType *adjust_ptr_allow_zero(CodeGen *g, ZigType *ptr_type, bool allow_zero) {