| ... | ... | @@ -5066,6 +5066,7 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc |
| 5066 | 5066 | return result; |
| 5067 | 5067 | } |
| 5068 | 5068 | } |
| 5069 | // TODO if the instruction is a get pointer instruction we can skip it |
| 5069 | 5070 | IrInstruction *load_ptr_instruction = ir_build_load_ptr(&ira->new_irb, source_instruction->scope, source_instruction->source_node, ptr); |
| 5070 | 5071 | load_ptr_instruction->type_entry = child_type; |
| 5071 | 5072 | return load_ptr_instruction; |
| ... | ... | @@ -6853,7 +6854,13 @@ static TypeTableEntry *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstru |
| 6853 | 6854 | return container_type; |
| 6854 | 6855 | } else if (is_container_ref(container_type)) { |
| 6855 | 6856 | assert(container_ptr->type_entry->id == TypeTableEntryIdPointer); |
| 6856 | | return ir_analyze_container_field_ptr(ira, field_name, field_ptr_instruction, container_ptr, container_type); |
| 6857 | if (container_type->id == TypeTableEntryIdPointer) { |
| 6858 | TypeTableEntry *bare_type = container_ref_type(container_type); |
| 6859 | IrInstruction *container_child = ir_get_deref(ira, &field_ptr_instruction->base, container_ptr); |
| 6860 | return ir_analyze_container_field_ptr(ira, field_name, field_ptr_instruction, container_child, bare_type); |
| 6861 | } else { |
| 6862 | return ir_analyze_container_field_ptr(ira, field_name, field_ptr_instruction, container_ptr, container_type); |
| 6863 | } |
| 6857 | 6864 | } else if (container_type->id == TypeTableEntryIdArray) { |
| 6858 | 6865 | if (buf_eql_str(field_name, "len")) { |
| 6859 | 6866 | ConstExprValue *len_val = allocate<ConstExprValue>(1); |