| ... | @@ -3853,6 +3853,9 @@ static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executa | ... | @@ -3853,6 +3853,9 @@ static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executa |
| 3853 | static LLVMValueRef ir_render_union_field_ptr(CodeGen *g, IrExecutable *executable, | 3853 | static LLVMValueRef ir_render_union_field_ptr(CodeGen *g, IrExecutable *executable, |
| 3854 | IrInstructionUnionFieldPtr *instruction) | 3854 | IrInstructionUnionFieldPtr *instruction) |
| 3855 | { | 3855 | { |
| | 3856 | if (instruction->base.value.special != ConstValSpecialRuntime) |
| | 3857 | return nullptr; |
| | 3858 | |
| 3856 | ZigType *union_ptr_type = instruction->union_ptr->value.type; | 3859 | ZigType *union_ptr_type = instruction->union_ptr->value.type; |
| 3857 | assert(union_ptr_type->id == ZigTypeIdPointer); | 3860 | assert(union_ptr_type->id == ZigTypeIdPointer); |
| 3858 | ZigType *union_type = union_ptr_type->data.pointer.child_type; | 3861 | ZigType *union_type = union_ptr_type->data.pointer.child_type; |
| ... | @@ -4077,6 +4080,9 @@ static LLVMValueRef ir_render_test_non_null(CodeGen *g, IrExecutable *executable | ... | @@ -4077,6 +4080,9 @@ static LLVMValueRef ir_render_test_non_null(CodeGen *g, IrExecutable *executable |
| 4077 | static LLVMValueRef ir_render_optional_unwrap_ptr(CodeGen *g, IrExecutable *executable, | 4080 | static LLVMValueRef ir_render_optional_unwrap_ptr(CodeGen *g, IrExecutable *executable, |
| 4078 | IrInstructionOptionalUnwrapPtr *instruction) | 4081 | IrInstructionOptionalUnwrapPtr *instruction) |
| 4079 | { | 4082 | { |
| | 4083 | if (instruction->base.value.special != ConstValSpecialRuntime) |
| | 4084 | return nullptr; |
| | 4085 | |
| 4080 | ZigType *ptr_type = instruction->base_ptr->value.type; | 4086 | ZigType *ptr_type = instruction->base_ptr->value.type; |
| 4081 | assert(ptr_type->id == ZigTypeIdPointer); | 4087 | assert(ptr_type->id == ZigTypeIdPointer); |
| 4082 | ZigType *maybe_type = ptr_type->data.pointer.child_type; | 4088 | ZigType *maybe_type = ptr_type->data.pointer.child_type; |
| ... | @@ -5750,7 +5756,6 @@ static void ir_render(CodeGen *g, ZigFn *fn_entry) { | ... | @@ -5750,7 +5756,6 @@ static void ir_render(CodeGen *g, ZigFn *fn_entry) { |
| 5750 | assert(executable->basic_block_list.length > 0); | 5756 | assert(executable->basic_block_list.length > 0); |
| 5751 | for (size_t block_i = 0; block_i < executable->basic_block_list.length; block_i += 1) { | 5757 | for (size_t block_i = 0; block_i < executable->basic_block_list.length; block_i += 1) { |
| 5752 | IrBasicBlock *current_block = executable->basic_block_list.at(block_i); | 5758 | IrBasicBlock *current_block = executable->basic_block_list.at(block_i); |
| 5753 | //assert(current_block->ref_count > 0); | | |
| 5754 | assert(current_block->llvm_block); | 5759 | assert(current_block->llvm_block); |
| 5755 | LLVMPositionBuilderAtEnd(g->builder, current_block->llvm_block); | 5760 | LLVMPositionBuilderAtEnd(g->builder, current_block->llvm_block); |
| 5756 | for (size_t instr_i = 0; instr_i < current_block->instruction_list.length; instr_i += 1) { | 5761 | for (size_t instr_i = 0; instr_i < current_block->instruction_list.length; instr_i += 1) { |