| ... | @@ -11132,7 +11132,13 @@ static TypeTableEntry *ir_analyze_bit_shift(IrAnalyze *ira, IrInstructionBinOp * | ... | @@ -11132,7 +11132,13 @@ static TypeTableEntry *ir_analyze_bit_shift(IrAnalyze *ira, IrInstructionBinOp * |
| 11132 | | 11132 | |
| 11133 | static TypeTableEntry *ir_analyze_bin_op_math(IrAnalyze *ira, IrInstructionBinOp *bin_op_instruction) { | 11133 | static TypeTableEntry *ir_analyze_bin_op_math(IrAnalyze *ira, IrInstructionBinOp *bin_op_instruction) { |
| 11134 | IrInstruction *op1 = bin_op_instruction->op1->other; | 11134 | IrInstruction *op1 = bin_op_instruction->op1->other; |
| | 11135 | if (type_is_invalid(op1->value.type)) |
| | 11136 | return ira->codegen->builtin_types.entry_invalid; |
| | 11137 | |
| 11135 | IrInstruction *op2 = bin_op_instruction->op2->other; | 11138 | IrInstruction *op2 = bin_op_instruction->op2->other; |
| | 11139 | if (type_is_invalid(op2->value.type)) |
| | 11140 | return ira->codegen->builtin_types.entry_invalid; |
| | 11141 | |
| 11136 | IrBinOp op_id = bin_op_instruction->op_id; | 11142 | IrBinOp op_id = bin_op_instruction->op_id; |
| 11137 | | 11143 | |
| 11138 | // look for pointer math | 11144 | // look for pointer math |
| ... | @@ -12851,6 +12857,12 @@ static TypeTableEntry *ir_analyze_dereference(IrAnalyze *ira, IrInstructionUnOp | ... | @@ -12851,6 +12857,12 @@ static TypeTableEntry *ir_analyze_dereference(IrAnalyze *ira, IrInstructionUnOp |
| 12851 | if (type_is_invalid(ptr_type)) { | 12857 | if (type_is_invalid(ptr_type)) { |
| 12852 | return ira->codegen->builtin_types.entry_invalid; | 12858 | return ira->codegen->builtin_types.entry_invalid; |
| 12853 | } else if (ptr_type->id == TypeTableEntryIdPointer) { | 12859 | } else if (ptr_type->id == TypeTableEntryIdPointer) { |
| | 12860 | if (ptr_type->data.pointer.ptr_len == PtrLenUnknown) { |
| | 12861 | ir_add_error_node(ira, un_op_instruction->base.source_node, |
| | 12862 | buf_sprintf("index syntax required for unknown-length pointer type '%s'", |
| | 12863 | buf_ptr(&ptr_type->name))); |
| | 12864 | return ira->codegen->builtin_types.entry_invalid; |
| | 12865 | } |
| 12854 | child_type = ptr_type->data.pointer.child_type; | 12866 | child_type = ptr_type->data.pointer.child_type; |
| 12855 | } else { | 12867 | } else { |
| 12856 | ir_add_error_node(ira, un_op_instruction->base.source_node, | 12868 | ir_add_error_node(ira, un_op_instruction->base.source_node, |