| ... | @@ -522,7 +522,6 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -522,7 +522,6 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { |
| 522 | | 522 | |
| 523 | TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdOptional); | 523 | TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdOptional); |
| 524 | assert(child_type->type_ref || child_type->zero_bits); | 524 | assert(child_type->type_ref || child_type->zero_bits); |
| 525 | assert(child_type->di_type); | | |
| 526 | entry->is_copyable = type_is_copyable(g, child_type); | 525 | entry->is_copyable = type_is_copyable(g, child_type); |
| 527 | | 526 | |
| 528 | buf_resize(&entry->name, 0); | 527 | buf_resize(&entry->name, 0); |
| ... | @@ -532,12 +531,14 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -532,12 +531,14 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { |
| 532 | entry->type_ref = LLVMInt1Type(); | 531 | entry->type_ref = LLVMInt1Type(); |
| 533 | entry->di_type = g->builtin_types.entry_bool->di_type; | 532 | entry->di_type = g->builtin_types.entry_bool->di_type; |
| 534 | } else if (type_is_codegen_pointer(child_type)) { | 533 | } else if (type_is_codegen_pointer(child_type)) { |
| | 534 | assert(child_type->di_type); |
| 535 | // this is an optimization but also is necessary for calling C | 535 | // this is an optimization but also is necessary for calling C |
| 536 | // functions where all pointers are maybe pointers | 536 | // functions where all pointers are maybe pointers |
| 537 | // function types are technically pointers | 537 | // function types are technically pointers |
| 538 | entry->type_ref = child_type->type_ref; | 538 | entry->type_ref = child_type->type_ref; |
| 539 | entry->di_type = child_type->di_type; | 539 | entry->di_type = child_type->di_type; |
| 540 | } else { | 540 | } else { |
| | 541 | assert(child_type->di_type); |
| 541 | // create a struct with a boolean whether this is the null value | 542 | // create a struct with a boolean whether this is the null value |
| 542 | LLVMTypeRef elem_types[] = { | 543 | LLVMTypeRef elem_types[] = { |
| 543 | child_type->type_ref, | 544 | child_type->type_ref, |