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

@@ -578,6 +578,7 @@ ZigType *get_pointer_to_type_extra2(CodeGen *g, ZigType *child_type, bool is_con
}
switch (ptr_len) {
case PtrLenSingle:
assert(sentinel == nullptr);
buf_appendf(&entry->name, "*");
break;
case PtrLenUnknown: