stage1: fix crash with slice type
This commit is contained in:
parent
e05ecbf165
commit
98583be6e1
@ -825,6 +825,7 @@ ZigType *get_array_type(CodeGen *g, ZigType *child_type, uint64_t array_size, Zi
|
||||
}
|
||||
|
||||
ZigType *get_slice_type(CodeGen *g, ZigType *ptr_type) {
|
||||
Error err;
|
||||
assert(ptr_type->id == ZigTypeIdPointer);
|
||||
assert(ptr_type->data.pointer.ptr_len == PtrLenUnknown);
|
||||
|
||||
@ -833,6 +834,11 @@ ZigType *get_slice_type(CodeGen *g, ZigType *ptr_type) {
|
||||
return *parent_pointer;
|
||||
}
|
||||
|
||||
// We use the pointer type's abi size below, so we have to resolve it now.
|
||||
if ((err = type_resolve(g, ptr_type, ResolveStatusSizeKnown))) {
|
||||
codegen_report_errors_and_exit(g);
|
||||
}
|
||||
|
||||
ZigType *entry = new_type_table_entry(ZigTypeIdStruct);
|
||||
|
||||
buf_resize(&entry->name, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user