| ... | @@ -11416,6 +11416,20 @@ static TypeTableEntry *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstru | ... | @@ -11416,6 +11416,20 @@ static TypeTableEntry *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstru |
| 11416 | buf_ptr(&child_type->name), buf_ptr(field_name))); | 11416 | buf_ptr(&child_type->name), buf_ptr(field_name))); |
| 11417 | return ira->codegen->builtin_types.entry_invalid; | 11417 | return ira->codegen->builtin_types.entry_invalid; |
| 11418 | } | 11418 | } |
| | 11419 | } else if (child_type->id == TypeTableEntryIdPointer) { |
| | 11420 | if (buf_eql_str(field_name, "child")) { |
| | 11421 | bool ptr_is_const = true; |
| | 11422 | bool ptr_is_volatile = false; |
| | 11423 | return ir_analyze_const_ptr(ira, &field_ptr_instruction->base, |
| | 11424 | create_const_type(ira->codegen, child_type->data.pointer.child_type), |
| | 11425 | ira->codegen->builtin_types.entry_type, |
| | 11426 | ConstPtrMutComptimeConst, ptr_is_const, ptr_is_volatile); |
| | 11427 | } else { |
| | 11428 | ir_add_error(ira, &field_ptr_instruction->base, |
| | 11429 | buf_sprintf("type '%s' has no member called '%s'", |
| | 11430 | buf_ptr(&child_type->name), buf_ptr(field_name))); |
| | 11431 | return ira->codegen->builtin_types.entry_invalid; |
| | 11432 | } |
| 11419 | } else { | 11433 | } else { |
| 11420 | ir_add_error(ira, &field_ptr_instruction->base, | 11434 | ir_add_error(ira, &field_ptr_instruction->base, |
| 11421 | buf_sprintf("type '%s' does not support field access", buf_ptr(&child_type->name))); | 11435 | buf_sprintf("type '%s' does not support field access", buf_ptr(&child_type->name))); |